u1in
u1in
简单易懂!赞!
为什么data要挂在prototype上呢?不能每个类实例维护自己的data吗?
> > 为什么data要挂在prototype上呢?不能每个类实例维护自己的data吗? > > 本来就是实例维护自己的data啊... ```javascript function Component(){ } Component.prototype.data = { count : 0 } ``` 我是对上述这段代码提出疑问,为什么不是 ```javascript function Component(){ this.data = { count: 0 } } ```...
> @FINDarkside > > > Fails `Expect` test because it strips away already existing readonly modifier from `title`. > > ```ts > type MyReadonly2 = { > [p in keyof...