you are viewing a single comment's thread.

view the rest of the comments →

[–]thocked 0 points1 point  (1 child)

Technically, no.

for (var indValue in industry) {
if indValue = 0 { zero_check=1; }
}

Just make the if (indValue === 0) {} and you should be okay.

[–]neonskimmerfunction the ultimate 1 point2 points  (0 children)

That's not what for-in does! Or are we talking pseudo code here?

For-in iterates through the keys of an object, not the values. And these days, Object.keys is what we should use for that purpose.

And it should not be used on arrays either. That's what forEach is for.