Last active
January 30, 2018 08:11
-
-
Save entaku0818/6f19c634658cee78887a4318cc806078 to your computer and use it in GitHub Desktop.
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
# Imperative | |
const people = ['Amanda', 'Geoff', 'Michael', 'Richard', 'Ryan', 'Tyler'] | |
const excitedPeople = [] | |
for (let i = 0; i < people.length; i++) { | |
excitedPeople[i] = people[i] + '!' | |
} | |
# Declarative | |
const people = ['Amanda', 'Geoff', 'Michael', 'Richard', 'Ryan', 'Tyler'] | |
const excitedPeople = people.map(name => name + '!') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Imperativeは処理重視の考え方
Declarativeは結果重視の考え方