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>
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");
});
});
Source: stackoverflow.com
Related Query
- searching for a string in multiple arrays with forEach
- Searching for JS based (Highcharts, AnyChart, etc) thermometer or vertical linear gauge with multiple pointers
- Highcharts not displaying series data for graph with multiple Y-axes
- Highcharts, how to change hover bg color for series with multiple columns (categories)
- Highchart Zoom and X-Axis with String Array for Categories
- String with multiple whitespaces on javascript
- How to use Highcharts React to create chart with multiple lines for same XAxis?
- Retrieving JSON data for Highcharts with multiple series?
- How to set column width for columnRange chart with multiple series
- Highcharts for multiple plot lines each with a different color and show tooltip?
- My Highcharts graph with multiple axis ignores the max value I set for the first yaxis
- Proper format of json for Highchart.js with multiple series
- How to have multiple highcharts with different series data in vuejs without repeating code
- Issue in multiple exporting for HighChart with scrollbar
- Line and column combo chart with multiple columns for each category, how to position line marker for each category on a specific column?
- Highchart Color Issue for series with single data with multiple colors
- Create array from string - with complex types for highchart
- Generate JSON files for Hightcharts with PHP from a TCP string
- export multiple highcharts with text area for their highcharts to multiple PDF file
- C# Parse string into arrays for HighCharts
- create multiple arrays from SQL dataset in classic ASP for HighCharts
- Background color for multiple Highchart panes, in Vue app
- highcharts - chart names for multiple pie chart series in one chart
- Highcharts Custom tooltips for multiple series
- Convert from string with milliseconds to date object Javascript
- Rails - convert date string into javascript date object for highcharts
- Loading multiple Highcharts with jquery.load
- Highcharts polar spider with multiple y-axis scale
- Highcharts with JSON data and multiple series
- Highcharts - Issue with negative values when displaying multiple axes
More Query from same tag
- How to set minutes as units in Highstock chart using data from CSV
- highcharts - log axis not working
- how to pass values to tooltip which not in x and y axis in highcharts
- How to programatically (Python) scrape streaming live stock chart ticker data and its indicators
- Highcharts - Custom X axis format
- High charts not displaying proper data timestamp
- How to overlay two kinds of world maps over each other on Highmaps
- Is there a way to increase the sensitivity of a specific point, in the purpose of showing a tooltip?
- Converting String value to int to be used within highchart
- Click event in treemap in highcharts
- Setting max column amount in highchart column chart type
- Strange behavior of Highchart tool tip
- Highcharts Graph displaying 0 value continuously : Javascript Array
- how to get value from other script? (in html)
- Update json array values in javascript
- HighStock setup
- High Charts not honouring the label format
- Highchart - Boxplot - Extra category shown with no data
- On click, passing a variable from Javascript into Rails/Ruby
- Dynamically graph points with Highcharts
- Highcharts's onReady event?
- Highcharts: significant decimals in the tooltip
- How to position the Highcharts.StockChart's rangeSelector zoom on the right?
- how to fetch data from json file in highchart
- Internationalization in highcharts?
- Variable in valueSuffix?
- Putting the Z-Coordinate in the Highcharts Tooltip
- On Page With Numerous HighCharts, One Particular Chart Not Displaying.
- Issue with Dates - trying to plot MongoDB data in Highcharts via PHP
- Highcharts: How to create Pie-Donut Chart with 1 slice to have 1 layer and other slices to have 2 layers