话说前端39- es6

2023-01-28 0 580

话说前端39- es6

撷取浓厚兴趣,散播欢乐,

快速增长所见所闻,遗留下幸福!

亲爱的您,这儿是LearningYard辅仁。

那时小贴士为你增添话说后端39-es6

结语的出访!

Shareinterests, spread happiness,

increaseknowledge, and leave beautiful!

Dearyou, this is LearningYard Academy.

Today,the editor brings you the knowledge of using flexsim software (39)-es6,

welcome your visit!

我们所说的ES5和ES6其实就是在js语法的发展过程中的一个版本而已

ECMAScript就是js的语法。以前的版本没有某些功能随着es5、es6这些版本的更新出现就会新增一些好用的功能。

S6的主要目的是为了解决 ES5 的先天不足。ES = ECMAScript 是一个动态脚本语言的‘标准’,JS = JavaScript是对ES的标准,默认,主流的‘实现’,由于商标权的问题,欧洲计算机协会制定的语言标准不能叫做JS,只能叫ES;

ES6新标准的目的是:使得JS可以用来开发大型的Web应用,成为企业级开发语言。而企业级开发语言就是:适合模块化开发,拥有良好的依赖管理。

What we call ES5 and ES6 is actually a version in the development of js grammar.

ECMAScript is the syntax of js. The previous version did not have some functions. With the update of es5 and es6, some useful functions will be added.

The main purpose of S6 is to solve the congenital deficiency of ES5. ES = ECMAScript is the standard of a dynamic scripting language, and JS = JavaScript is the standard for ES, which is the default and the mainstream implementation. Due to the trademark rights, the language standard formulated by the European Computer Association cannot be called JS, but only ES;

The purpose of the new ES6 standard is: JS can be used to develop large-scale Web applications and become an enterprise-level development language. The enterprise-level development language is: suitable for modular development, with good dependency management.

为什么需要学习es6:

主流的浏览器都已经全面支持ES6

行业内较新的后端框架都已经全面使用ES6的语法

微信小程序,uni-app等都是基于ES6的语法

Why do you need to learn es6:

All mainstream browsers have fully supported ES6.

The newer front-end frameworks in the industry have fully used ES6 syntax.

WeChat applet, uni-app, etc. are all based on ES6 syntax.

ES6的声明关键字:

let声明

比var更严格,要先定义再使用。

并且不能重复变量名。

块级作用域,如果在函数里面使用,只能在函数里出访,外边就出访不到。

const声明

只能声明常量(不被改变的)。

常量声明之后必须要被赋值。

注意const去声明对象,然后改变对象中属性的属性值,这个是被允许的。

ES6 declaration keyword:

Let statement

It is stricter than var, so it should be defined before use.

And variable names cannot be repeated.

Block scope, if used inside a function, can only be accessed inside the function, but not outside.

Const statement

Only constants (unchangeable) can be declared.

Constants must be assigned after being declared.

Note that const declares the object and then changes the attribute value of the attribute in the object. This is allowed.

ES6的箭头函数

话说前端39- es6

()可以省略:当只有一个形参的时候可以省略小括号。

{}可以省略:当只有一句代码,或者只有一个返回值的时候可以省略。(返回对象要注意)

箭头函数没有argument。

箭头函数的this指向。this的指向为父级作用域的。

函数可以赋予默认参数

对象的简写

话说前端39- es6

当对象里面的属性和属性名一致的情况,可以直接简写成一个属性名就行

解构赋值

话说前端39- es6
话说前端39- es6

Arrow function of ES6

() Can be omitted: Parentheses can be omitted when there is only one formal parameter.

{} can be omitted: it can be omitted when there is only one code or only one return value. (Pay attention to returning objects)

The arrow has no argument.

This of the arrow points to. The point of this is the of the parent scope.

Functions can give default parameters.

Abbreviation of object

When the attribute in the object is consistent with the attribute name, it can be simply abbreviated as an attribute name.

Deconstruction

那时的撷取就到这儿了,

如果您对文章有独特的想法,欢迎给我们留言。

让我们相约明天,祝您那时过得开心欢乐!

Thatsit for todays sharing.

If you have a unique idea about the article.

pleaseleave us a message.

Letus meet tomorrow

Iwish you a happy day today!

翻译:百度翻译

参考资料:百度百科

声明:本文由LearningYard新辅仁原创,如有侵权,请联系删除!

文案&排版|李仕阳

审核|维安

举报/反馈

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务