检查数组的每个元素
这个问题在这里已经有了答案:
您可以在一行函数中使用Array.prototype.every()
arr = ["foo","azeaze", "wazeazerar"]
const isittrue = currentval => currentval.length > 2
console.log(arr.every(isittrue));
链接地址: http://www.djcxy.com/p/70035.html
上一篇: check every element of an array
下一篇: Why does this happen when the for in loop is used in Javascript?