How to break out from foreach loop in javascript
This question already has an answer here:
不要使用.forEach然后循环:
var myObj = [{"a": "1","b": null},{"a": "2","b": 5}]
var result = false
for(var call of myObj) {
console.log(call)
var a = call['a'], b = call['b']
if(a == null || b == null) {
result = false
break
}
}
链接地址: http://www.djcxy.com/p/70044.html