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.
Explain this
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 ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment