I got an array with different school grades. This data is gathered from a json file. In this array there are also grades that are 0. These are grades from students that didn’t complete the course. I want to remove all the 0 in the array, but I have no idea how to start.
example of the array:
var grades = [7,6,4,0,4,8,9,6,6,10,0,7,8,6,7]
p.s. I’m using d3
You can try
Array.filter:As commenteers correctly noted,
.filteris not avail in all browsers. You can use the shim available on MDN (see link above), or re-write your code to something like this: