0
I’m trying to make a way .map()
, but I’m not getting it. My last code was this:
var double = x => x * 2;
function filtro(funcao, numeros) {
let arr = [];
for (let i = 0; i < numeros.length; i++){
arr.push(numeros[i](funcao));
}
return arr;
}
console.log(filtro(double, [1, 2, 3, 4, 5, 6, 7, 8, 10]));
It would have to return: 2,4,6,4,10. etc...
Someone can help me ?
The code is losing its temper, I’ve already edited twice.
– Jota
@wmsouza Fala mano, boa noite. É não, ali ele usa o map do javascript, no meu código no caso, I’m creating the map, got it ?
– Jota