using filter method for arrays

PHOTO EMBED

Fri Aug 16 2024 01:14:31 GMT+0000 (Coordinated Universal Time)

Saved by @thecowsays #javascript

const favoriteWords = ['nostalgia', 'hyperbole', 'fervent', 'esoteric', 'serene'];

// Call .filter() on favoriteWords below

const longFavoriteWords = favoriteWords.filter(word => {
  return word.length > 7;
});

console.log(longFavoriteWords);
content_copyCOPY

www.codecademy.com