about summary refs log tree commit diff stats
path: root/js
diff options
context:
space:
mode:
authorelioat <hi@eli.li>2024-05-29 22:39:21 -0400
committerelioat <hi@eli.li>2024-05-29 22:39:21 -0400
commit57e4b991c1a57899720b5d50a56fc8eff49ed52c (patch)
tree6d82d0119f691e79c0e4a1e007e79113b338a436 /js
parent7c274a16b7e21d71ab08a8dc4a720c331b5af481 (diff)
downloadtour-57e4b991c1a57899720b5d50a56fc8eff49ed52c.tar.gz
*
Diffstat (limited to 'js')
-rw-r--r--js/freelance.js16
1 files changed, 14 insertions, 2 deletions
diff --git a/js/freelance.js b/js/freelance.js
index 29e0705..a7534b3 100644
--- a/js/freelance.js
+++ b/js/freelance.js
@@ -1,4 +1,11 @@
 // can I go freelance?
+// doing some math to see if I can afford to go freelance, or what it'd take to do it
+
+// r is hourly rate
+// h is hours per week
+// w is weeks per year
+// ws is weeks of savings
+// returns object with income, savings, and tax where income is after tax and savings are subtracted
 
 const a = (r,h,w,ws) => {
 	let income = ((r * h) * w);
@@ -13,6 +20,11 @@ const a = (r,h,w,ws) => {
 	};
 }
 
-const m = a(125,24,48,300);
+const m = a(125,24,48,300); // $125/hr, 24 hours/week, 48 weeks/year, saving $300 a week
+console.log(`annual income: $${m.income}, annual savings: $${m.savings}, annual tax: $${m.tax}`);
+
+const n = a(100,30,48,300); // $100/hr, 30 hours/week, 48 weeks/year, saving $300 a week
+console.log(`annual income: $${n.income}, annual savings: $${n.savings}, annual tax: $${n.tax}`);
 
-console.log(`annual income: $${m.income}, annual savings: $${m.savings}, annual tax: $${m.tax}`);
\ No newline at end of file
+const o = a(75,30,48,300); // $75/hr, 40 hours/week, 48 weeks/year, saving $300 a week
+console.log(`annual income: $${o.income}, annual savings: $${o.savings}, annual tax: $${o.tax}`);
\ No newline at end of file