Question 26
Consider the below JavaScript program.
Array.prototype.double = function (arr) { const res = []; for (let i=0; i<placeholder.length; i++) res.push(placeholder[i] * 2); return res;}
const arr = [2, 3, 7, 8];console.log(arr.double());What of the following can be used in place of “placeholder” in the above program so that the program yields the below output array?
[ 4, 6, 14, 16 ]
arr
Array
this
The program cannot yield such an output, and is implemented in a wrong way.