Question: JAVASCRIPT /*********************************************************************** Write a function using fat arrow syntax, `tipCalculator` that takes in an arbitrary number of arguments as prices, adds them up and returns
JAVASCRIPT /*********************************************************************** Write a function using fat arrow syntax, `tipCalculator` that takes in an arbitrary number of arguments as prices, adds them up and returns a string containing the recommended tip following this format: "Cost: $x.xx, Recommended Tip: $x.xx". Use a tip percentage of 23%. Hint: Look up `toFixed()` on MDN Examples: console.log(tipCalculator(25, 35)); // 'Cost: $60.00, Recommended Tip: $13.80' console.log(tipCalculator(2.50, 2.50, 4.95, 5.75)); // 'Cost: $15.70, Recommended Tip: $3.61' console.log(tipCalculator(6.99, 8.99, 29.99)); // 'Cost: $45.97, Recommended Tip: $10.57'
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
