当前位置:网站首页>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 )

边栏推荐
猜你喜欢

For example, the visual appeal of the live broadcast of NBA Finals can be seen like this?

TiDB v6.0.0 (DMR) :缓存表初试丨TiDB Book Rush
This Exception was thrown from a job compiled with Burst, which has limited exception support. report errors

vsftpd服务的部署及优化

远程登录sshd服务

Solve the problem of reading package listsdonebuilding dependency treereading state informationdone

Industry analysis - quick intercom, building intercom

Scientific research - web of science retrieval skills

Wealth management for programmers

JS基础8
随机推荐
Oracle 日期格式化异常:无效数字
Convert the file URL in the browser to a file stream
董宇辉,新东方以及凤凰卫视
Katalon global variable is referenced in testobject
[monkey] Introduction to monkey test
使用ssm项目对Mysql8进行访问的时候,出现连接失败和一些错误的解决办法
李宏毅《机器学习》丨7. Conclusion(总结)
GCC简介
TiDB v6.0.0 (DMR) :缓存表初试丨TiDB Book Rush
论文阅读 (59):Keyword-Based Diverse Image Retrieval with Variational Multiple Instance Graph
Making and using of dynamic library (shared library)
windows 10下载安装mysql5.7
Redis6 1: what problems can be solved by the introduction of NoSQL and redis?
拼接String集合中的字符串_基于Stream
AGCO AI frontier promotion (6.28)
This Exception was thrown from a job compiled with Burst, which has limited exception support. 报错
基于验证码识别的机器学习项目captcha_trainer操作实践
使用logrotate对宝塔的网站日志进行自动切割
太阳能无线LED显示屏的特点
分析list中有无重复数据且重复了几次