Created
November 27, 2019 20:59
-
-
Save gmoqa/5b4bd8078a9f0f92c471b0e8234a3f28 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
const games = [ | |
{ name: 'The Witcher 3 - The Wild Hunt', rating: 10, plataform: 'Multi' }, | |
{ name: 'The Witcher 2', rating: 9, plataform: 'Multi' }, | |
{ name: 'Startropics', rating: 9, plataform: 'NES' }, | |
{ name: 'The Legend of Zelda', rating: 10, plataform: 'NES' }, | |
{ name: 'Ghost Trick', rating: 10, plataform: 'NDS' }, | |
{ name: 'Hotel Dusk', rating: 8, plataform: 'NDS' }, | |
{ name: 'The Legend of Zelda - Ocarina of Time', rating: 10, plataform: 'N64' }, | |
{ name: 'The Legend of Zelda - Majora Mask', rating: 9, plataform: 'N64' }, | |
{ name: 'Chrono Trigger', rating: 10, plataform: 'SNES' }, | |
{ name: 'Final Fantasy 3', rating: 9, plataform: 'SNES' }, | |
{ name: 'The Legend of Zelda - A link to the past', rating: 10, plataform: 'SNES' }, | |
{ name: 'Phantasy Star IV', rating: 10, plataform: 'SG' }, | |
{ name: 'Sonic The Hedgehog 3', rating: 9, plataform: 'SG' }, | |
{ name: 'Sonic The Hedgehog 2', rating: 9, plataform: 'SG' }, | |
{ name: 'Super Mario Galaxy', rating: 10, plataform: 'Wii' }, | |
{ name: 'Shadow of the Collossus', rating: 10, plataform: 'PS2' }, | |
{ name: 'The Last of Us', rating: 10, plataform: 'PS3' }, | |
{ name: 'Uncharted 2 - Among Thieves', rating: 10, plataform: 'PS3' }, | |
{ name: 'Uncharted 3 - Drake\'s Deception', rating: 10, plataform: 'PS3' } | |
] | |
const gamesUpper = games.map(game => game.name.toUpperCase()) | |
const gamesRating = games.reduce((accumulator, game) => accumulator + game.rating, 0) | |
const snes = games.filter((game) => game.plataform === 'PS3') | |
console.log(snes) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment