ā€œSpend After Savingā€: Function Parameters | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

ā€œSpend After Savingā€: Function Parameters

https://code.sololearn.com/cfRYCYS4h2pG/?ref=app Iā€™ve tried numerous ways, but havenā€™t figured this one out. Functions 25.3. Please help!

11th Jan 2022, 3:43 AM
TahitišŸŒCastillo
TahitišŸŒCastillo - avatar
4 Answers
+ 7
//try this function main() { let salary= parseInt(readLine(), 10); // complete the function call getSavings(salary) } //complete the function function getSavings(salary) { save= salary * .15; console.log(save) }
11th Jan 2022, 4:09 AM
Simba
Simba - avatar
+ 6
Everything should work. You could just try them. All you need a variable to assign a value(salary*.15) Here, you just missed console.log() to print the output.
11th Jan 2022, 4:31 AM
Simba
Simba - avatar
+ 2
Simba Unbelievable. Why did ā€œsaveā€ work and not (salary) or getSavings? Also, thanks a million for this.
11th Jan 2022, 4:19 AM
TahitišŸŒCastillo
TahitišŸŒCastillo - avatar
+ 2
Ok. Thanks again Simba . Thatā€™s very helpful. šŸ˜
11th Jan 2022, 4:34 AM
TahitišŸŒCastillo
TahitišŸŒCastillo - avatar