es6新增特性:
let const兩者都有塊級作用域
箭頭函式
模板字串
解構賦值
for of迴圈
import export匯入匯出
set資料結構
...展開運算子
修飾器@
class類繼承
async、await
promise
symbol
proxy**
運算元組的方法:
es5:concat、join、push、pop、shift、unshift、slice、splice、substring 和 substr 、sort、 reverse、indexof 和 lastindexof 、every、some、filter、map、foreach、reduce
es6:find、findindex、fill、copywithin、array.from、array.of、entries、values、key、includes
ES6新增特性
let 1.let宣告的變數不會掛在window中,不會像var宣告的變數一樣造成全域性變數的汙染 2.新增了乙個塊級作用域 以前只有函式作用域,全域性作用域 3.let是不允許重複宣告 4.let不會有宣告提前 var num 15 全域性變數 console.log num 15 console...
ES6新增特性
1 變數定義 const let 2 解構 3 箭頭函式 核心 this的指向 4 模板字面量 5 spread rest 物件展開 6 子符串 陣列新增方法 console.log str.includes de true,字串是否包含de console.log str.endswith ef ...
ES6陣列新增方法
1 字串轉陣列 個人感覺有些類似於arr.split let str hello console.log array.from str array 5 h e l l o 2 將類陣列物件轉換為真正陣列 let arrlist let arr array.from arrlist console.l...