score:2

I suppose you're having an array of arrays. In that case you can do the below.

results.data.forEach(function(arr){
   arr.forEach(function(itm){
      console.log(itm == "null" ? "I found a zero" : "Didn't find a zero"); 
   });
});

score:0

Edit, Updated

Try

// `arr`: array of arrays ,
// iterate each array , test for string `"null"` ,
// log results
var arr = [[1,2,3,"null"], ["null", 2,3,4], [1,"null", 3,4], [1,2,3,4]];
var filtered = function(arr) {
  $.each(arr, function(key, value) {
    // filter string `"null"` 
    var res = $.inArray("null", value);
    // if `"null"` found , log index of `"null"` within `arr`
    console.log(res !== -1 
                ? "found 'null' at index " + res + " within array " + key 
                : "'null' not found within array " + key)
  })
};

filtered(arr);

var arr = [[1,2,3,"null"], ["null", 2,3,4], [1,"null", 3,4], [1,2,3,4]];
var filtered = function(arr) {
  $.each(arr, function(key, value) {

    var res = $.inArray("null", value);

    console.log(res !== -1 
                ? "found 'null' at index " + res + " within array " + key 
                : "'null' not found within array " + key)
  })
};

filtered(arr);
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>


Related Articles