function MyArray() {
var self = this.arguments; //<---
this.toString = function() {
return self;
};
}
var c = new MyArray(2, 3, 1, '232');
console.log(c.toString());
不明确的
function MyArray() {
var self = arguments; //<---
this.toString = function() {
return self;
};
}
var c = new MyArray(2, 3, 1, '232');
console.log(c.toString());
[2,3,1,'232']
那么,为什么会这样呢?this.arguments和arguments有什么区别?