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

边栏推荐
猜你喜欢

Yann LeCun新论文:构建自动智能体之路

Solve the problem of reading package listsdonebuilding dependency treereading state informationdone

Making and using of dynamic library (shared library)

静态库的制作和使用

Training notice | special training notice on epidemic prevention and security prevention for overseas Chinese funded enterprises, institutions and personnel in 2022

Katalon framework tests web (XX) custom keywords and upload pop-up operations

Yann Lecun's new paper: the road to building automatic agents

JS foundation 3

QML控件类型:TabBar

Wealth management for programmers
随机推荐
Recommended practice sharing of Zhilian recruitment based on Nebula graph
《运营之光3.0》全新上市——跨越时代,自我颠覆的诚意之作!
Convert the file URL in the browser to a file stream
[function suggestion] select a space when multiple workspaces are started
分析list中有无重复数据且重复了几次
将浏览器中的文件 url转换为File流
[practice] appium settings app is not running after 5000ms
Dataease installation upgrade
无法重新声明块范围变量
Mysql安装配置以及解决重装Mysql时忘记root password问题
Yann LeCun新论文:构建自动智能体之路
SQL中的DQL、DML、DDL和DCL是怎么区分和定义的
windows 10下载安装mysql5.7
方法重写(Override)
[QT] connect syntax reference implementation
李宏毅《机器学习》丨7. Conclusion(总结)
使用 Calendar 计算时间
Docker modifies the user name and password of MySQL
Calculate time using calendar
Katalon global variable is referenced in testobject