-
-
Save getify/decc32526a241c586bac134c713e0f0d to your computer and use it in GitHub Desktop.
exploring readability differences
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
let names = people.map(personToGetNameFrom => personToGetNameFrom.name); | |
// ****************** | |
let getName = person => person.name; | |
let names = people.map(getName); | |
// ****************** | |
function getName(person) { return person.name; } | |
let names = people.map(getName); | |
// ***************** | |
let names = people.map(function getName(person){ return person.name; }); | |
// ***************** | |
let names = people.map(prop("name")); | |
// ********************************************** | |
// ********************************************** | |
// ********************************************** | |
function getNames(people) { /* ... */ } | |
let names = getNames(people); | |
// ***************** | |
let getNames = map(prop("name")); | |
let names = getNames(people); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment