<script>
var plugin = (function () {
function Plugin() {
}
Plugin.prototype = {
constructor : Plugin,
initCount : 0,
count:function () {
this.initCount ++
return this.initCount
}
}
return Plugin
})()
</script>截图

为什么p2.count()的结果为1,原型对象不是共享属性和方法吗,initCount 是原型对象的属性,为什么p1和p2没有共享
未期而遇
遥望星辰_
西兰花伟大炮
随时随地看视频慕课网APP
相关分类