let pets = ['Dog', 'Cat', 'Hamster', 'Squirrel'];
let filterPets = pets.filter(function(element){
  return element.length > 4;
});

console.log(filterPets);

console.log(pets);

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://codepen.io/nullobject/pen/cngzI.js