From 7c274a16b7e21d71ab08a8dc4a720c331b5af481 Mon Sep 17 00:00:00 2001 From: elioat Date: Wed, 29 May 2024 22:30:54 -0400 Subject: * --- js/freelance.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 js/freelance.js (limited to 'js') diff --git a/js/freelance.js b/js/freelance.js new file mode 100644 index 0000000..29e0705 --- /dev/null +++ b/js/freelance.js @@ -0,0 +1,18 @@ +// can I go freelance? + +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 m = a(125,24,48,300); + +console.log(`annual income: $${m.income}, annual savings: $${m.savings}, annual tax: $${m.tax}`); \ No newline at end of file -- cgit 1.4.1-2-gfad0