Skip to content

Instantly share code, notes, and snippets.

@LearningMaterial
Created April 3, 2018 18:11
Show Gist options
  • Save LearningMaterial/0761e1065a43ef841ed5463680744ef3 to your computer and use it in GitHub Desktop.
Save LearningMaterial/0761e1065a43ef841ed5463680744ef3 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(league => league.type === "la_liga")
.filter(league => league.target === "Argentain_player")
.map(league => 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