I need to check if array contains at least one empty elements. If any of the one element is empty then it will return false.
Example:
var my_arr = ne
You can check by looping through the array with a simple for
, like this:
function NoneEmpty(arr) {
for(var i=0; i
You can give it a try here, the reason we're not using .indexOf()
here is lack of support in IE, otherwise it'd be even simpler like this:
function NoneEmpty(arr) {
return arr.indexOf("") === -1;
}
But alas, IE doesn't support this function on arrays, at least not yet.