Created
April 3, 2018 16:54
-
-
Save LearningMaterial/e4cba0767f4db25afeba6ce0aab9d708 to your computer and use it in GitHub Desktop.
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
const footballLeagues = [ | |
{ type: "english_premier_league", total_goal: 341, target: "English-player" }, | |
{ type: "english_premier", total_goal: 341, target: "English-player" }, | |
{ type: "bundesliga", total_goal: 341, target: "German-player" }, | |
{ type: "english_premier_league", total_goal: 341, target: "English-player" }, | |
{ type: "la_liga", total_goal: 411, target: "Spanish_player" }, | |
{ type: "la_liga", total_goal: 101, target: "Argentain_player" } | |
]; | |
const la_ligaDetail = footballLeagues | |
.filter(function(league) { | |
return league.type === "la_liga"; | |
}) | |
.filter(function(league) { | |
return league.target === "Argentain_player"; | |
}) | |
.map(function(league) { | |
return league.total_goal; | |
}); | |
console.log(la_ligaDetail); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment