0
What is the output of this code??
var score=[12,7,14]; var getMax= Math.max(...score); console.log(getMax); //Answer is 14 Does anyone know how the answer came about??
2 Answers
+ 1
... is called a spread operator.
...score is nothing but 12, 7, 14.
It just copies the values in the array.
Math.max(12,7,14) is 14.
0
Thanks đđ