Open this example in the interactive library
Source code
console.log(
[1, 2, 3, 4]
.values()
.filter((n) => n % 2 === 0)
.map((n) => n * 10)
.toArray(),
);
Sample output
[ 20, 40 ]

Open this example in the interactive library
console.log(
[1, 2, 3, 4]
.values()
.filter((n) => n % 2 === 0)
.map((n) => n * 10)
.toArray(),
);
[ 20, 40 ]