如何更改数字、字符串或数组的当前值?
String.prototype.change_me = function() { this = '123'; }
Number.prototype.change_me = function() { this = 123; }
Array.prototype.change_me = function() { this = [1,2,3]; }
x = '234';
x.change_me(); // error
x = 234;
x.change_me(); // error
x = [2,3,4];
x.change_me(); // error
错误是:ReferenceError: Invalid left-hand side in assignment
我想我以前做过这个,但我忘了怎么做..