ES6复读器
CONST&LET
用于代替var。
当您想要不可更改的数据时,将const用于块级作用域
让将允许范围内的数据多变
箭头功能
如果代码块只有一行,我们可以使用箭头功能来缩短功能长度。 例如
const sayHello = name => console . log ( `Hello ${ name } ` ) ;
代替
const sayHello = function ( name {
console . log ( `Hello ${ name } ` ) ;
} ) ;
前瞻
用于遍历数组
const fruits = [ "Apples" , "Oranges" , "Grape" ] ;
fruits . forEacch ( ( fruit , index ) => console . log ( fruit ) ) ;
地图
与forEach方