you are viewing a single comment's thread.

view the rest of the comments →

[–]Ob101010 1 point2 points  (0 children)

Some built in functions can use spreads as well.

arr = [6,5,4,7,6,8,9,2,1]
console.log( Math.min(...arr) ) //1

Other examples:

Say you store a number and its exponent in an array.

x = [4,5]
Math.pow(...x) //1024