JavaScript · Junior · Question 30 of 75

What does Math.max(...[3, 7, 2]) return?

Explanation

Spread "expands" the array into separate arguments: Math.max(3, 7, 2). Without spread, Math.max([3, 7, 2]) returns NaN. Spread is also used to copy and merge arrays and objects.

Further reading

Problem with a question

JavaScript · Junior · question 30

Test yourself

Take the JavaScript · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz