Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

use .map(), .filter() js

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]
 
PREVIOUS NEXT
Tagged: #js
ADD COMMENT
Topic
Name
7+8 =