ifrizz / ife-frizz

Programming Practice in Front-End Development
http://ife.baidu.com/
0 stars 1 forks source link

JS OOP #3

Open w10u opened 8 years ago

w10u commented 8 years ago

喵酱,为啥你写这个OOP笔记里Inheritance的时候没有写到这里(页面偏下)说的 Object.create方法?(以及为啥这么多方法我好晕...

cececx commented 8 years ago

Object.create似乎是第五版标准出的功能(也是一种对class的模拟),和prototype相比,可以直接实例化空对象 Object.create(null),但是不是closure,不能实现private方法,实例对象之间不能共享数据……是一种更简洁的声明方式……

w10u commented 8 years ago

喵老师能解释一下

不是closure,不能实现private方法,实例对象之间不能共享数据

是啥意思吗?(这里俨然变成了Piazza...

cececx commented 8 years ago

OOP笔记更新辣!

Closure闭包详情传送门

cececx commented 8 years ago

我看到第三种定义方法的时候——(天啦噜还能这么玩儿谁想出来的??!!!

w10u commented 8 years ago

妈呀我还想吐槽没有点赞功能。。还真有!