I have framed an array like below
iArray = [true, true, false, false, false, false, false, false, true, true, true, false,
true, false, false, false, false, true]
Condtional check:
If anyone of the value in this array is false I will be showing an error message
else if everything is true I will be showing success message.
I tired below code to iterate, however couldn't frame the logic in it.
var boolIteration = iArray.split(',');
var i;
for (i = 0; i < boolIteration.length; ++i) {
//conditional check
}
I'm struggling to iterate the array using the above condition.
Can anyone point me in the right direction with an efficient solution.
iArrayis already an array, why are you trying to split it like a string?.splitis to convert a string into an array by a separator!if(~$.inArray(false, iArray)){...}indexOfhas compatibility issue in IE, I will go with your jQuery solution. Thank you.