Array.prototype.reverse = function() {
var arr_proto = this;
var arr_1;
for(var i = 0, j = this.length; i < this.length; i++,j--) {
arr_1[i] = arr_proto[j];
}
// ...
for(var k=0; k< this.length; k++) {
arr_proto[k] = arr_1[k];
}
return this;
};
var arr = [15,5,1,2];
arr.reverse(); // ошибка "TypeError: Cannot set property '0' of undefined