当前位置:网站首页>Class pattern and syntax in JS 2021.11.10
Class pattern and syntax in JS 2021.11.10
2022-06-28 11:23:00 【Little dream of becoming a big man】
es6 Added class Kind of grammar , Like most object-oriented languages Use classes to generate objects , but es6 Of class Just a class syntax sugar , Formal grammar Simplified writing , Achieve parity , It's essentially a constructor + Patterns of prototype objects .
Constructors Used to create attributes , Prototype object setting method .

// Constructors + Prototype object The structure is messy ,class Is to put them together , Give Way js More elegant object-oriented
It is written as follows :

class Grammatical norms of :
1、 Constructor has preload - Declaration upgrade , but class No, ;
2、class Inside , The default is the strict mode environment ;(es5 New strict mode , Is to put the code Put it in a safer place 、 Run in an efficient environment - Regular validation )

边栏推荐
猜你喜欢

一套十万级TPS的IM综合消息系统的架构实践与思考

TiDB v6.0.0 (DMR) :缓存表初试丨TiDB Book Rush

Spatial-Temporal时间序列预测建模方法汇总

Docker modifies the user name and password of MySQL

Practice and Thinking on the architecture of a set of 100000 TPS im integrated message system

Thesis reading (59):keyword based diverse image retrieval with variable multiple instance graph

功能真花哨,价格真便宜!长安全新SUV真实力到底怎样?

数据库系列:有什么办法对数据库的业务表进行无缝升级

智联招聘基于 Nebula Graph 的推荐实践分享

论文阅读 (59):Keyword-Based Diverse Image Retrieval with Variational Multiple Instance Graph
随机推荐
太阳能无线LED显示屏的特点
乌国家安全与国防委员会秘书:将对俄境内目标进行精确打击
关于Pytorch中双向LSTM的输出表示问题
远程登录sshd服务
JS基础5
Makefile简介
GCC简介
Basic 02: variable, remember the mobile number of the object
Metersphere implements UI automation elements that are not clickable (partially occluded)
SQL必需掌握的100个重要知识点:检索数据
String & heap & method area
Which broker is safer and more convenient to open an account for Oriental Fortune mobile stock?
Characteristics of solar wireless LED display
Training notice | special training notice on epidemic prevention and security prevention for overseas Chinese funded enterprises, institutions and personnel in 2022
Everyone can participate in open source! Here comes the most important developer activity in dragon lizard community
Katalon framework tests a web page operation example code
Tidb v6.0.0 (DMR): initial test of cache table - tidb Book rush
动态库(共享库)的制作和使用
还在用 SimpleDateFormat 做时间格式化?小心项目崩掉!
JS foundation 4