[英]I have problem with if statement in forEach [closed]
為什么如果我使用if(i===true)
而不是if(i)
代碼不起作用?
function bouncer(arr) {
var newArr =[ ];
arr.forEach(function(i){
// why if use if(i===true)the code dont run?
if ( i ){
newArr.push(i);
}});
return newArr;
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.