Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript filter

const filtered = array.filter(item => {
    return item < 20;
});
// An example that will loop through an array
// and create a new array containing only items that
// are less than 20. If array is [13, 65, 101, 19],
// the returned array in filtered will be [13, 19]
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #javascript #filter
ADD COMMENT
Topic
Name
2+1 =