Skip to content

Instantly share code, notes, and snippets.

@tballas
Last active April 21, 2018 08:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tballas/7a0b403f79d9140355014b012ad3bca5 to your computer and use it in GitHub Desktop.
Save tballas/7a0b403f79d9140355014b012ad3bca5 to your computer and use it in GitHub Desktop.
// "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