Created
March 29, 2016 08:03
-
-
Save zy108830/ad77ae32f82571132678 to your computer and use it in GitHub Desktop.
调用Math对象的min和max方法,求数组中的最小值和最大值
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var arr=[1,2,3,4,5]; | |
console.log(Math.min.apply(null,arr));//1 | |
console.log(Math.max.apply(null,arr));//5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment