Question about Iterators


Why do I have to use the method every() on interestingWords and pass word.length > 5? I thought the method filter() did that already by picking on the words that are length > 5. Is the every() method just for testing purposes?

let interestingWords = words.filter(function(word) {
  return word.length > 5;

console.log(interestingWords.every(word => word.length > 5));


Yes, for filtering every word longer than five letters.