javascript node filter code example
Example 1: filter javascript array
var words = ['spray', 'limit', 'elite', 'exuberant', 'destruction', 'present'];
const result = words.filter(word => word.length > 6);
console.log(result);
Example 2: js array .filter
const words = ['spray', 'limit', 'elite', 'exuberant', 'destruction', 'present'];
const result = words.filter(word => word.length > 6);
console.log(result);
Example 3: JavaScript Array Methods .filter()
const colours = ['green', 'black', 'dark-orange', 'light-yellow', 'azure'];
const result = colours.filter(colour => colour.length > 6);
console.log(result);