💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
```js var array = [5, 7, 2, 3, 4, 1, 7, 9, 6]; ``` ## 循环遍历数组元素 ```js var min = array[0], index = 0; for (var i = 1; i < array.length; i++) { if (min > array[i]) { min = array[i]; index = i; } } ``` ## Apply ```js var min = Math.min.apply(null, array); console.log(min) ``` ## Math求值 ```js var [a, b, ...c] = array; console.log(a, b, c) var min = Math.min(...array); console.log(min) ```