Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javavscript array.filter with array.map

var arr = [1, 25, 20, 4];

var sum = arr.map((item) => item * 10).filter((item) => item > 100);
var sum2 = arr.map((item) => item * 10)
console.log("sum2", sum2)
// sum2 : (4) [10, 250, 200, 40]
console.log("sum", sum);
// sum : (2) [250, 200]
Source by www.freecodecamp.org #
 
PREVIOUS NEXT
Tagged: #javavscript
ADD COMMENT
Topic
Name
2+7 =