Skip to content

Instantly share code, notes, and snippets.

@jchiatt
Created October 22, 2018 22:28
Show Gist options
  • Save jchiatt/110c881c8d7181ff7aee70bee4473051 to your computer and use it in GitHub Desktop.
Save jchiatt/110c881c8d7181ff7aee70bee4473051 to your computer and use it in GitHub Desktop.
How to Filter a JavaScript Array - Ending
const exercises = [
{ name: "Bench Press", muscle: "Chest" },
{ name: "Back Squat", muscle: "Legs" },
{ name: "Deadlift", muscle: "Back" },
{ name: "Bent Over Row", muscle: "Back" },
{ name: "Overhead Press", muscle: "Shoulders" }
];
const backDay = exercises.filter(exercise => exercise.muscle === "Back");
console.table(backDay);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment