Skip to content

Instantly share code, notes, and snippets.

@aledwassell
Created November 23, 2016 02:33
Show Gist options
  • Save aledwassell/702c0bf4b9be5cab496087837585c6c9 to your computer and use it in GitHub Desktop.
Save aledwassell/702c0bf4b9be5cab496087837585c6c9 to your computer and use it in GitHub Desktop.
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