Skip to content

Instantly share code, notes, and snippets.

@mgdm
Created December 3, 2015 15:39
Show Gist options
  • Save mgdm/a9449b9b1e822dc65bc8 to your computer and use it in GitHub Desktop.
Save mgdm/a9449b9b1e822dc65bc8 to your computer and use it in GitHub Desktop.

Revisions

  1. mgdm created this gist Dec 3, 2015.
    8 changes: 8 additions & 0 deletions wat.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    var input = ['1', '2', '3'];

    var a = input.map(parseInt);
    console.log(a); // [ 1, NaN, NaN ]

    var b = input.map(n => parseInt(n));
    console.log(b); // [ 1, 2, 3 ]