JavaScript Demo: Array.filter()

var words = [‘spray’, ‘limit’, ‘elite’, ‘exuberant’, ‘destruction’, ‘present’];

const result = words.filter(word => word.length > 6);

// expected output: Array [“exuberant”, “destruction”, “present”]

  • Does the first letter start at of any object/ word in an array start at 0? how to access individual letters in the words in the array.

you can use charat function to access characters. see more here:

just remember, strings are immutable so you cannot modify a string like you do an array

You don’t need to count individual letters, look at what the line of code there already does.

It loops over all the words in words and keeps only those that are over a certain length