Sum of salaries
EasyObjects3 min
Write a function sumSalaries(salaries). In the object salaries each key is a name and each value is a salary.
Return the sum of all salaries. For an empty object return 0.
Examples
sumSalaries({ John: 100, Pete: 300, Mary: 250 })Returns 650
sumSalaries({})Returns 0
Loading the editor...
- Input
sumSalaries({ John: 100, Pete: 300, Mary: 250 })Expected650 - Input
sumSalaries({})Expected0
Hidden tests run on Submit