Created
September 21, 2019 19:23
-
-
Save niktariy/16e4d3fa7f71a33a188ccbd312015dcf to your computer and use it in GitHub Desktop.
Arrow function as a callback function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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