Beginner
Any number of numbers
Write three functions using rest parameters and spread:
sumAll(...nums) returns the total of all its arguments (0 when there are none).
average(...nums) returns their average, or 0 when there are no numbers (never NaN).
largest(list) takes an array and returns its biggest number, using Math.max with spread.
What Check tests
sumAll(1, 2, 3, 4)is 10sumAll()with no arguments is 0sumAllworks with many argumentsaverage(2, 4, 6)is 4average()is 0, not NaNlargestfinds the biggest number in an array
Stuck? One hint at a time
The solution unlocks after your first Check. Try first: that is where the learning happens.
Runs in your browser. Your code is saved here.
Press Run to see the page.
Console
Nothing printed yet.