Skip to main content
Rollback to Revision 19
Source Link
user229044
  • 237.1k
  • 41
  • 341
  • 342

Three main options Three main options:

Three main options:

Added examples and benchmark of options.
Source Link
dthree
  • 20.6k
  • 14
  • 79
  • 112

Three main optionsThree main options:

Three main options:

Simplify arrow function
Source Link
Mateen Ulhaq
  • 26.6k
  • 20
  • 115
  • 147
  1. for (var i = 0; i < xs.length; i++) { console.log(xs[i]); }
  2. xs.forEach((x, i) => { console.log(x); });
  3. for (const x of xs) { console.log(x); }

2. Array.prototype.forEach:

  1. for (var i = 0; i < xs.length; i++) { console.log(xs[i]); }
  2. xs.forEach((x, i) => { console.log(x); });
  3. for (const x of xs) { console.log(x); }

2. Array.prototype.forEach

  1. for (var i = 0; i < xs.length; i++) { console.log(xs[i]); }
  2. xs.forEach((x, i) => console.log(x));
  3. for (const x of xs) { console.log(x); }

2. Array.prototype.forEach:

Short summary at top.
Source Link
Mateen Ulhaq
  • 26.6k
  • 20
  • 115
  • 147
Loading
Active reading [<https://en.wikipedia.org/wiki/Sentence_clause_structure#Run-on_sentences> (see also <https://twitter.com/PeterMortensen/status/1199839973215739907>) ]. Added some context. Expanded.
Source Link
Peter Mortensen
  • 31.3k
  • 22
  • 109
  • 132
Loading
Commonmark migration
Source Link
Loading
fix grammar errors and typos
Source Link
Christian C. Salvadó
  • 821.6k
  • 184
  • 924
  • 840
Loading
proofread a little more, also clarified "off-by-one-error"
Source Link
Loading
edited body
Source Link
Jonathan Hall
  • 78.2k
  • 17
  • 153
  • 200
Loading
Added executable examples, added map and reduce examples and antipatterns
Source Link
Christian C. Salvadó
  • 821.6k
  • 184
  • 924
  • 840
Loading
update answer, add ES5 forEach, ES6 for-of, pros / cons
Source Link
Christian C. Salvadó
  • 821.6k
  • 184
  • 924
  • 840
Loading
added 7 characters in body
Source Link
Jonathan Hall
  • 78.2k
  • 17
  • 153
  • 200
Loading
added 36 characters in body
Source Link
MonkeyZeus
  • 20.7k
  • 4
  • 38
  • 80
Loading
Fix external link by pointing to http://web.archive.org/
Source Link
Loading
deleted 2 characters in body
Source Link
suspectus
  • 17k
  • 8
  • 51
  • 60
Loading
added 386 characters in body
Source Link
Christian C. Salvadó
  • 821.6k
  • 184
  • 924
  • 840
Loading
added 588 characters in body; added 399 characters in body
Source Link
Christian C. Salvadó
  • 821.6k
  • 184
  • 924
  • 840
Loading
Source Link
Christian C. Salvadó
  • 821.6k
  • 184
  • 924
  • 840
Loading