配列 var myArray = new Array("red", "green", "blue"); myArray.toS(); 結果 オブジェクト var myObject = {'a':[1,2,3],'b':'hoge','c':33}; myObject.toS(); 結果 Object.prototype.toS() Object.prototype.toS = function() { var con = this.constructor; if(con == String) { return '"' + this + '"'; } else if(con == Number) { return this; } else if(con == Array) { var res = '['; for(var i=0,len=this.length;i<len;i++) { if

