Tell us what’s happening:
May you please help me with understanding some grammar? My current challenge says, " The Array
instance can be accessed in the myMap
method using this
."
In layman terms, what is the Array instance
?
I have done some reading on this subject and I seek to finally understand the word instance.
**Your code so far**
// The global variable
const s = [23, 65, 98, 5];
Array.prototype.myMap = function(callback) {
const newArray = [];
return newArray;
};
const new_s = s.myMap(function(item) {
return item * 2;
});
console.log(new_s)
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36
Challenge: Implement map on a Prototype
Link to the challenge: