let pets = ['Dog', 'Cat', 'Hamster', 'Squirrel']; let filterPets = pets.filter(function(element){ return element.length > 4; }); console.log(filterPets); console.log(pets);
This Pen is owned by Marina Yamaoto on CodePen.
See more by @marina294 on CodePen
This Pen doesn't use any external CSS resources.