Created
December 12, 2018 06:41
-
-
Save zempo/8d6d31ee7cbbe1e3efb61c21542891d6 to your computer and use it in GitHub Desktop.
Looping over collections of objects example created by zempo1 - https://repl.it/@zempo1/Looping-over-collections-of-objects-example
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 users = [ | |
{ | |
name: 'Bernard', | |
age: 29, | |
birthMonth: 'April', | |
}, | |
{ | |
name: 'Bernice', | |
age: 14, | |
birthMonth: 'December', | |
}, | |
{ | |
name: 'Gerard', | |
age: 88, | |
birthMonth: 'June', | |
}, | |
{ | |
name: 'Stella', | |
age: 3, | |
birthMonth: 'September', | |
}, | |
]; | |
users.forEach(user => | |
console.log(`${user.name} will be ${user.age + 1} in ${user.birthMonth}`) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment