I'm newbie in js. I redefined push() method in Array Object like below..
Array.prototype.push = function(item) {
this[this.length] = '[' + item + ']';
return this;
};
var arr = new Array();
arr.push('my');
console.debug(arr);
console.debug(arr[0]);
arr.push('name');
console.debug(arr);
console.debug(arr[1]);
arr.push('is');
console.debug(arr);
console.debug(arr[2]);
// output
[] --> <1>
[my]
[] --> <2>
[name]
[] --> <3>
[is]
but I can't understand why <1>,<2>,<3> is empty.