Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

常用的ES6、ES7、ES8特性 #9

Open
mamba-1024 opened this issue Oct 15, 2018 · 3 comments
Open

常用的ES6、ES7、ES8特性 #9

mamba-1024 opened this issue Oct 15, 2018 · 3 comments

Comments

@mamba-1024
Copy link
Owner

ES全称ECMAScript,ECMAScript是ECMA制定的标准化脚本语言。

@mamba-1024
Copy link
Owner Author

mamba-1024 commented Oct 15, 2018

常用的es6特性:

  • let 和 const定义变量
  • 字符串模板(${ tmp }
  • 类(class)
  • Set
 // 去除数组的重复成员
[...new Set(array)]
// 也可以用于去除字符串里面的重复字符
[...new Set('ababbc')].join('')
// "abc"
  • 模块化(Module)
  • 箭头函数
  • 扩展运算符(...)
  • 函数参数默认值
  • Promise

@mamba-1024
Copy link
Owner Author

mamba-1024 commented Oct 16, 2018

es7特性:

  • includes()
  • 指数操作符 ( ** 基本上很少有到)
    x ** y =》 Math.pow(x, y)

@mamba-1024
Copy link
Owner Author

mamba-1024 commented Oct 16, 2018

es8特性:

  • async/await
    这个2016就可以用了,只是后来加在了ECMAScript2017标准中
  • Object.values()
  • Object.entries()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant