Answers for "js array filter and return"

CSS
0

JavaScript Array Methods .filter()

const colours = ['green', 'black', 'dark-orange', 'light-yellow', 'azure'];
// a 6 karakternél hosszab színekre szűrünk:
const result = colours.filter(colour => colour.length > 6);
console.log(result);
// --> [ 'dark-orange', 'light-yellow' ]
Posted by: Guest on May-07-2021
0

filter array elements

int[] a = {1,2,3,4};
boolean contains = IntStream.of(a).anyMatch(x -> x == 4);
Posted by: Guest on July-26-2021

Browse Popular Code Answers by Language