Skip to content

Instantly share code, notes, and snippets.

@arcticmouse
Last active January 28, 2020 05:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arcticmouse/9659a274cb4812ddceb4b4cc6c5691c5 to your computer and use it in GitHub Desktop.
Save arcticmouse/9659a274cb4812ddceb4b4cc6c5691c5 to your computer and use it in GitHub Desktop.
techtonica dogs
let dogs = [
{name:'Osito', age: 15},
{name:'Nana', age: 1},
{name:'Bella', age: 8},
]
function filterDogs(minimumAge){
let dogs2 = []
for(let i = 0; i<dogs.length; i++){
if(minimumAge <= dogs[i].age)
dogs2.push(dogs[i])
}
return dogs = dogs2
}
filterDogs(10)
console.log(dogs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment