checking and replacing a value in an array jquery
- by liz
i have a table of data:
<table id="disparities" class="datatable">
<thead>
<tr>
<th scope="col">Events</th> <th scope="col">White</th> <th scope="col">Black</th> <th scope="col">Hispanic</th><th scope="col">Asian/Pacific Islands</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Hospitalizations</th>
<td>0.00</td>
<td>20</td>
<td>10</td>
<td>5</td>
</tr>
<tr>
<th scope="row">ED Visits</th>
<td>19</td>
<td>90</td>
<td>40</td>
<td>18</td>
</tr>
</tbody>
</table>
i have a function that retrieves the values from the above table into an array like so (0.00,19)
var points1 = $('#disparities td:nth-child(2)').map(function() {
return $(this).text().match(/\S+/)[0];
}).get();
i want to check if there is a 0.00 value (or it could be just 0) and change that value to NA...
so my resulting array is then (NA,19)
not really sure how to go about this, whether in the initial match or as a separate action...