I'm having difficulties understanding this code. Help plss | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
0

I'm having difficulties understanding this code. Help plss

var s = [23, 65, 98, 5]; Array.prototype.myMap = function(callback) { var newArray = []; this.forEach(a => newArray.push(callback(a))); return newArray; }; var new_s = s.myMap(function(item) { return item * 2; });

1st May 2020, 5:44 PM
Sajid
Sajid - avatar
1 Respuesta
1st May 2020, 6:17 PM
Kevin ★