Last active
April 21, 2018 08:26
-
-
Save tballas/7a0b403f79d9140355014b012ad3bca5 to your computer and use it in GitHub Desktop.
"I fixed it!" Arrow Functions example from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions
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
// "Fixed" Arrow Functions example from | |
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions | |
var materials = [ | |
'Hydrogen', | |
'Helium', | |
'Lithium', | |
'Argon', | |
'Tin', | |
'', | |
'Beryllium' | |
]; | |
console.log(materials.map(material => material.length)); | |
// expected output: Array [8, 6, 7, 5, 3, 0, 9] | |
// https://www.youtube.com/watch?v=6WTdTwcmxyo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment