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??

8th Jun 2021, 4:34 PM
S.P. Karthee
S.P. Karthee - avatar
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.
8th Jun 2021, 5:26 PM
Avinesh
Avinesh - avatar
0
Thanks 😊😊
8th Jun 2021, 5:39 PM
S.P. Karthee
S.P. Karthee - avatar