function MyString(str) { var newStr = [];
for(var count in str) { newStr[count] = str[count];
count++;
}; this.length = count;
return newStr;
}
MyString.prototype.abc=function(){
console.log("123")
} var s = new MyString("hello");
s.abc();浏览器报错 :demo2.html:27 Uncaught TypeError: s.abc is not a function(…)
添加回答
举报
0/150
提交
取消