This file contains hidden or 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
'use strict'; | |
const characters = [ | |
{ name: 'ironman', env: 'marvel' }, | |
{ name: 'black_widow', env: 'marvel' }, | |
{ name: 'wonder_woman', env: 'dc_comics' }, | |
]; | |
console.log( | |
characters |
This file contains hidden or 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
'use strict'; | |
const characters = [ | |
{ id: 1, name: 'ironman', env: 'marvel' }, | |
{ id: 2, name: 'black_widow', env: 'marvel' }, | |
{ id: 3, name: 'wonder_woman', env: 'dc_comics' }, | |
]; | |
function hasCharacterFrom(env) { | |
return character => character.env === env; |
This file contains hidden or 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
'use strict'; | |
const characters = [ | |
{ id: 1, name: 'ironman' }, | |
{ id: 2, name: 'black_widow' }, | |
{ id: 3, name: 'captain_america' }, | |
{ id: 4, name: 'captain_america' }, | |
]; | |
function getCharacter(name) { |
This file contains hidden or 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
'use strict'; | |
const characters = [ | |
'ironman', | |
'black_widow', | |
'hulk', | |
'captain_america', | |
'hulk', | |
'thor', | |
]; |