var num = 5,
all = false,
arr = [1, 5, 7, 9];
for(var i = 0; i < a.length; i++) {
if(arr[i] == num) {
}
}
var num = 5,
all = true,
arr = [1, 5, 7, 9];
for(var i = 0; i < a.length && all; i++) {
if( all )
all = arr[i] == num;
}
for(var i = 0; i < a.length && (all = arr[i] == num); i++);
var num = 5,
all = true,
arr = [1, 5, 7, 9];
for(var i = 0; i < a.length; i++) {
if(arr[i] != num) {
all = false;
break;
}
}
var num = 5,
arr = [1, 5, 7, 9],
all = arr.length?true:false;
for(var i = 0; i < arr.length; i++)
if(arr[i] != num) {
all = false;
break;
}
var num = 5,
arr = [1, 5, 7, 9];
all=arr.filter(function(item){ return item !=num; }).length?false:true;