Want to know the actual usage of Math.max
小朋友
小朋友 2018-05-13 18:37:36
0
1
1815

Math.max(1,2,3,4,5) What I want to know is how I can get and use this (1,2,3,4,5).

For example:

var a = [1,2,3,4,5]

var b = Math.max(a)

NaN

I want to use Math.max to get

小朋友
小朋友

reply all(1)
威尼斯

var a = [1,2,3,4,5];

var b = Math.max(...a);

es6 extended operator , you can go to Baidu to find out

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template