Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on A Reintroduction to JavaScript. Parent comment
1. Crockford's C style with cached array length (fast and flexible, but verbose):
for (let index = 0, length = array.length; index < length; index += 1) { console.log(index, array[index]); }
array.forEach((value, index) => console.log(index, value));
for (let value of array) { console.log(value); }
There are no comments on this comment yet.
1. Crockford's C style with cached array length (fast and flexible, but verbose):
2. Functional style (terse and flexible, but slow): 3. Python style (fast and terse, but not flexible): By "flexible" I mean being able to e.g. iterate over items with odd indexes or in reverse direction.