diff options
author | elioat <elioat@tilde.institute> | 2024-05-30 20:55:02 -0400 |
---|---|---|
committer | elioat <elioat@tilde.institute> | 2024-05-30 20:55:02 -0400 |
commit | 5ee6ec873890886971555fcba8b3850cd0ab9c57 (patch) | |
tree | 74ddb7236705d22f94f046692b27f14e98e0a1cf /js | |
parent | 57e4b991c1a57899720b5d50a56fc8eff49ed52c (diff) | |
download | tour-5ee6ec873890886971555fcba8b3850cd0ab9c57.tar.gz |
*
Diffstat (limited to 'js')
-rw-r--r-- | js/freelance.js | 42 |
1 files changed, 24 insertions, 18 deletions
diff --git a/js/freelance.js b/js/freelance.js index a7534b3..533fa98 100644 --- a/js/freelance.js +++ b/js/freelance.js @@ -7,24 +7,30 @@ // 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); - let tax = income * 0.16; // as of 2024 actual tax rate is more like 15.3%, but I'm rounding to 16% - income -= tax; - let savings = ws * w; - income -= savings; - return { - income: income, - savings: savings, - tax: tax - }; -} +const a = (r, h, w, ws) => { + let income = (r * h) * w; + const tax = income * 0.16; // as of 2024 actual tax rate is more like 15.3%, but I'm rounding to 16% + income -= tax; + const savings = ws * w; + income -= savings; + return { + income: income, + savings: savings, + tax: tax, + }; +}; -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 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}`); +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}`, +); -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 +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}`, +); |