javascript - Use js to write a function that does not limit the number of parameters and is required to return the maximum value among all parameters
天蓬老师
天蓬老师 2017-05-19 10:27:56
0
2
880

Write a function in js, without limiting the number of parameters, and return the maximum value of all parameters

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

reply all(2)
Peter_Zhu
function maxNum(){return Math.max.apply(null,arguments)}
Ty80
function maxNum(...args){
    return Math.max(...args)
}

maxNum(0,1,2,3,4,5,6,7,8,9);    //9
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template