• Courses
  • Code Compiler
  • Discuss
  • Pricing
  • Teams
Menu
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; });

javascriptjsprototype
1st May 2020, 5:44 PM
Sajid
Sajid - avatar
1 Answer
+ 2
https://code.sololearn.com/WS2QJ8nUp6wQ/?ref=app
1st May 2020, 6:17 PM
Kevin ★

Often have questions like this?

Learn more efficiently, for free:

  • Introduction to Python

    7.1M learners

  • Introduction to Java

    4.7M learners

  • Introduction to C

    1.5M learners

  • Introduction to HTML

    7.5M learners

See all courses
Hot today
How do I spawn random obstacles in my game if I'm using canvas?
2 Votes
Negative indexed, while positive indexed, slices
1 Votes
How to do a game
0 Votes
What could i use c# and c++ for?
1 Votes
the language in Arabic is wrong the English words with the Arabic words make faults please fix this problem fastest you can
1 Votes
Hey Guys, How to learn PHP in sololearn???
0 Votes
What course is worth and best in this time ?
0 Votes
What are ctx.save() and ctx.restore() in canvas?
0 Votes
اريد برنامج بيع شاهي احمر وشاهي حليب وكبتشينو
0 Votes
¿Cómo puedo aprender esto no entiendo del todo?
0 Votes