let 用來宣告可重新分配變量const 用來宣告不變的常量,就是不可以再做修改的變數(常數)var ES6以前版本使用
let
const
var
類別(Class)是先裡面定義好物件的整體結構藍圖(blue print),然後再用這個類別定義,以此來產生相同結構的多個的物件實例,類別在定義時並不會直接產生出物件,要經過實體化的過程(new運算符),才會產生真正的物件實體。
new
類別實際上是一種特別的函數(functions),就跟你可以定義函數敘述和函數宣告一樣,類別的語法有兩個元件:類別敘述(class expressions)和類別宣告(class declarations)。
迭代器(Iterator)是一種知道如何從集合裡每次以同樣的方式存取項目的物件。並保持對自己序列內部的目前位置的追蹤。
.forEach()
undefined
.map()
.filter()
JavaScript在ES6中引進Module系統,讓JavaScript可以模組化的開發 ── import、export。
可以像任何JavaScript類型一樣將對象分配給變量。我們使用花括號{}來指定對象文字:
{}
let spaceship = {};