I have an array of objects like this:
var chartData = [{count: 0, idTag: \"24\"} {count: 0, idTag: \"25\"} {count: 0, idTag: \"
If you're free to change the structure of chartData, why not just make it a hash instead of an array?
var chartData = {24: 0, 25: 0, 26: 0};
And then the loop becomes
for (i=0; i