Answers for "javavscript array.filter with array.map"

2

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]
Posted by: Guest on March-23-2021
0

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]
Posted by: Guest on June-08-2021

Code answers related to "javavscript array.filter with array.map"

Browse Popular Code Answers by Language