Skip to content

Instantly share code, notes, and snippets.

@itaditya
Created August 1, 2020 14:33
Show Gist options
  • Select an option

  • Save itaditya/2031fa54ed05410bcdb5738008e8d0a2 to your computer and use it in GitHub Desktop.

Select an option

Save itaditya/2031fa54ed05410bcdb5738008e8d0a2 to your computer and use it in GitHub Desktop.
(Blog) Why named arguments are better than positional arguments
const numbers = ['1', '4', '8', '10'];
console.log(numbers.map(parseInt));
// You might think the result would be-
[1, 4, 8, 10]
// Here's the actual output-
[ 1, NaN, NaN, 3 ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment