Skip to content

Instantly share code, notes, and snippets.

@LearningMaterial
Created April 3, 2018 16:54
Show Gist options
  • Save LearningMaterial/e4cba0767f4db25afeba6ce0aab9d708 to your computer and use it in GitHub Desktop.
Save LearningMaterial/e4cba0767f4db25afeba6ce0aab9d708 to your computer and use it in GitHub Desktop.
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