Hacker News new | ask | show | jobs
by likeclockwork 1777 days ago
Actually, for ... in does both.

It is you who doesn't think that loop does what it actually does.

Please read the spec and verify with your favorite JS runtime before continuing this argument.

1 comments

    for (x in [6,1,6,2,6,3]) {
      console.log(x);
    }
Please run this in your browser console and tell me if it iterates over the elements of the array.