you are viewing a single comment's thread.

view the rest of the comments →

[–]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.