Created
November 23, 2016 02:33
-
-
Save aledwassell/702c0bf4b9be5cab496087837585c6c9 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
var animals = [ | |
{ name: 'Fluffykins', attitude: 'happy', species: 'rabbit' }, | |
{ name: 'Caro', attitude: 'grumpy', species: 'dog' }, | |
{ name: 'Hamilton', attitude: 'selfish', species: 'dog' }, | |
{ name: 'Harold', attitude: 'urnest', species: 'fish' }, | |
{ name: 'Ursula', attitude: 'angry', species: 'cat' }, | |
{ name: 'Jimmy', attitude: 'content', species: 'fish' } | |
]; | |
var names = animals.map(function(animal) { | |
return animal.name + ' is a ' + animal.attitude + ' ' + animal.species; | |
}); | |
console.log(names); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment