I'm having difficulties understanding this code. Help plss | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
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 Answer
1st May 2020, 6:17 PM
Kevin ★