Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4
spread in Javascript is just like splat in Python. It is a convenient way to convert an array of values into just the values. Consider Math.max() . It can take 2, 3, 4, or more arguments. But if you feed it an array arr of several values, it won't return the max of the array. So you can use spread to just get the values from the array: Math.max(..arr)
9th Dec 2017, 1:01 AM
Eric Blinkidu
Eric Blinkidu - avatar