Last active
December 9, 2020 01:55
-
-
Save juliobetta/cec9fe8b5c1289896484e3c5fd41d85e 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 filtered = characters.filter(character => character.debut < 1990); | |
const reduced = characters.reduce((accumulator, character) => { | |
if(character.debut < 1990) { | |
return [...accumulator, character]; | |
} | |
return accumulator; | |
}, []); | |
// [ | |
// { "name": "Donkey Kong", "debut": 1981 }, | |
// { "name": "Link", "debut": 1986 } | |
// ]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment