以下代码的作用如下:
WeatherWidget.prototype = new Widget;
哪里Widget是构造函数,我想用新函数扩展Widget'类' WeatherWidget.
Widget
WeatherWidget
什么是new关键字在那里做什么以及如果被遗漏会发生什么?
new
javascript constructor prototype
constructor ×1
javascript ×1
prototype ×1