Skip to content

Instantly share code, notes, and snippets.

@niktariy
Created September 21, 2019 19:23
Show Gist options
  • Save niktariy/16e4d3fa7f71a33a188ccbd312015dcf to your computer and use it in GitHub Desktop.
Save niktariy/16e4d3fa7f71a33a188ccbd312015dcf to your computer and use it in GitHub Desktop.
Arrow function as a callback function
const scores = [ /* ...some scores here... */ ];
const maxScore = Math.max(...scores);
// Arrow Function as .map() callback
scores.map(score => +(score / maxScore).toFixed(2));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment