Skip to content

Instantly share code, notes, and snippets.

@sandrabosk
Last active November 7, 2023 21:10
Show Gist options
  • Save sandrabosk/0f0384200ec6f484d30d8e3d5c175020 to your computer and use it in GitHub Desktop.
Save sandrabosk/0f0384200ec6f484d30d8e3d5c175020 to your computer and use it in GitHub Desktop.
  1. Given an array of numbers, filter out the numbers that are not even, and are less than 100.
const numbers = [1, 60, 112, 123, 100, 99, 73, ];

// ... your code here
  1. From the given array of people, get the people who are allowed to consume alcoholic beverages (based on the US law). Bonus: Get just their names, we don't need their age.
const people = [
  { name: "Candice", age: 25 },
  { name: "Tammy", age: 30 },
  { name: "Allen", age: 49 },
  { name: "Nettie", age: 21 },
  { name: "Stuart", age: 17 },
  { name: "Bill", age: 19 }
];

// ... your code here
  1. Given the array of students, filter out just the ones who passed with the score 50 and more.
const students = [
  {
    name: "Peter",
    score: 50
  },
  {
    name: "Sarah",
    score: 40
  },
  {
    name: "Andy",
    score: 33
  },
  {
    name: "Grace",
    score: 70
  }
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment