Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript filter

const words = ['spray', 'limit', 'elite', 'exuberant', 'destruction', 'present'];

const threeLetterWords = words.filter(word => word.length <= 5)

console.log(threeLetterWords);

// RESULT: (3) ["spray", "limit", "elite"]
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #javascript #filter
ADD COMMENT
Topic
Name
7+3 =