let arr = [] Array.prototype._push = function () { for (let i in arguments) { arr[i] = arguments[i]; } return arr.length } console.log(arr._push(1, 2)); console.log(arr);