Iterators bug?

when I run the following code it throws ‘Did you put ‘word => word.length > 5’ inside of the parentheses?’
what am I missing here?

let words = ['unique', 'uncanny', 'pique', 'oxymoron', 'guise'];

// Something is missing in the method call below

console.log(words.some(function(word) {
  return word.length < 6;

// Use filter to create a new array
let interestingWords = words.filter(word => word.length > 5);

// Make sure to uncomment the code below and fix the incorrect code before running it

console.log(interestingWords.every(word => typeof 'string'));

can you please share exercise url?

it seems the exercise wants you to use the shorthand (word => word.length > 5) and not the full out written function like you did

the last line of your code:

console.log(interestingWords.every(word => typeof 'string'));

although true is returned, its not what the exercise had in mind, you have to use word.length > 5 like shown in the error message

Oh Ok. I thought it was giving me an error for the function on line 10. Not that last one. Thank you.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.