摘要: 一、new function CreateCat(name){ this.name = name; } var catA = new CreateCat('xiaoA'); console.log(catA.name)//xiaoA new做了什么操作: 1. 创建一个空对象 2. 将构造函数的pr 阅读全文
posted @ 2020-04-02 01:30 -加勒比海参 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 普通: var catA = { name:'xiaoA', eat:function(){ console.log('xiaoA eat something') } } var catB = { name:'xiaoB', eat:function(){ console.log('xiaoB ea 阅读全文
posted @ 2020-04-02 01:22 -加勒比海参 阅读(320) 评论(0) 推荐(0) 编辑