Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

filter array js

const arr = ['pine', 'apple', 'pineapple', 'ball', 'roll'];
const longWords = arr.filter(item => item.length > 5);

console.log(longWords);   // ['pineapple']
Source by learn.coderslang.com #
 
PREVIOUS NEXT
Tagged: #filter #array #js
ADD COMMENT
Topic
Name
2+1 =