1. 箭頭函數(shù)
函數(shù)體內(nèi)的this對象颅夺,就是定義時所在的對象掏导,而不是使用時所在的對象。调榄,不可以當做構(gòu)造函數(shù)踊赠,不可以使用arguments對象
function s(n1,n2) {
reutnr n1 + n2
}
==> var s = ( n1, n2) => n1+n2
當只有一句return語句的時候,可以省略 {}
2. Set Map
Set 數(shù)學中的集合每庆,無重復值筐带,是一個類數(shù)組,可以用 Array.from() 轉(zhuǎn)化為一個真數(shù)組
數(shù)組去重: Array.from(new Set([1,2,3,3,3,31,2,5]))
Map hash
3. Promise 異步解決方案
4. Module 模塊化
export default
import