Skip to content

Instantly share code, notes, and snippets.

@prof3ssorSt3v3
Last active May 12, 2020 06:08
Show Gist options
  • Save prof3ssorSt3v3/d7e260a0d25beaaedb1fd02d54a214b6 to your computer and use it in GitHub Desktop.
Save prof3ssorSt3v3/d7e260a0d25beaaedb1fd02d54a214b6 to your computer and use it in GitHub Desktop.
//Why do we get this weird result from the map method?
// myarray.map(func);
//We want to convert 3 strings into numbers
let result = ['1', '7', '11'].map(parseInt); //returns [1, NaN, 3]
console.log(result);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment