MyClass.prototype = { //重寫toString方法 toString : function() { var str = ""; for(var i=0; i<this.length-1; i++) { str += this[i] + ","; } str += this[this.length-1]; return str; } }