当前位置:网站首页>Typescript防止基类被实例化
Typescript防止基类被实例化
2022-07-28 21:36:00 【RemoteDev】
class BaseClass{
constructor() {
console.log(new.target,new.target == BaseClass);
//防止基类被实例化
if (new.target === BaseClass){
throw new Error('基类只能被继承,不能被实例化');
}
}
}
class SubClass extends BaseClass{
constructor() {
super();
}
}
//let bc = new BaseClass();//基类禁止实例化,会报错
let sc = new SubClass();边栏推荐
- DirectX修复工具下载(exagear模拟器数据包在哪里)
- WebView whitelist
- 无代码开发平台通讯录入门教程
- Improvement 14 of yolov5: replace the backbone network C3 with the lightweight network GhostNet
- 业界首创云原生安全检测双模型!安全狗重磅报告亮相数字中国建设峰会
- The safety dog has been selected into many details of cloud security panorama 2.0
- Thesis reading (1) - zfnet of classification
- Yolov5 improvement 12: replace backbone network C3 with lightweight network shufflenetv2
- pg_ Installation and use of RMAN "PostgreSQL"
- In 2020, the top ten domestic IC design enterprises will be exposed! These five industrial challenges still need to be overcome!
猜你喜欢

Sqlilabs-1 (breakthrough record)

Servlet的使用手把手教学(一)

安全狗入选《云安全全景图2.0》多个细项

The industry's first cloud native security detection dual model! Safety dog heavyweight report appears at the digital China Construction Summit

《Shortening passengers’ travel time A dynamic metro train scheduling approach using deep reinforcem》

Rouyi cloud platform - how to realize the launch and login functions of the project and how to create new modules

Thesis reading (1) - zfnet of classification

Recurrent neural network (RNN)

Sdwebimage source code combs 5 author motivation, modifies directory, and changes inheritance relationship

Introduction to address book export without code development platform
随机推荐
Introduction to address book export without code development platform
歌尔股份与上海泰矽微达成长期合作协议!专用SoC共促TWS耳机发展
即将获售高通、联发科芯片,荣耀要超越华为做国内第一?
Goer shares and Shanghai Taisi Weida growth cooperation agreement! Special SOC jointly promotes the development of TWS headphones
TypeError: can‘t convert cuda:0 device type tensor to numpy. Use Tensor. cpu() to copy the tensor to
软件测试面试笔试题及答案(软件测试题库)
c语言进阶篇:指针(三)
Symbol symbol type
[mongodb] basic use of mongodb database, special cases, and the installation and creation process of mongoose (including the installation of mongoose fixed version)
Yolov5 improvement 12: replace backbone network C3 with lightweight network shufflenetv2
Record a question about the order of trigonometric function exchange integrals
Thesis reading (3) - googlenet of classification
Sdwebimage source code combs 5 author motivation, modifies directory, and changes inheritance relationship
In 2020, the top ten domestic IC design enterprises will be exposed! These five industrial challenges still need to be overcome!
Sqlilabs-1 (breakthrough record)
MySQL foundation - data query
DirectX repair tool download (where is exagear simulator package)
Applet Download Preview PDF, document cannot open solution
无代码开发平台通讯录入门教程
Invest 50billion yuan! SMIC capital was officially registered!