Advanced-Frontend / Daily-Interview-Question

我是依扬(木易杨),公众号「高级前端进阶」作者,每天搞定一道前端大厂面试题,祝大家天天进步,一年后会看到不一样的自己。
https://muyiy.cn/question/
27.43k stars 3.29k forks source link

异乡人 #560

Open alonso123qwe opened 2 years ago

alonso123qwe commented 2 years ago

const arr = [-10, 0, 10, 21, 0, -7, 35, 7, 9, 23, 18] let arr2 = [] arr.map(item =>{ if(item>0){ arr2.push(item) } }) let num = Math.min.apply(null,arr2) console.log(num)