Skip to content

Type#

Type annotation#

在參數後加上 : type,先宣告型別,若賦予其他型別將會報錯。

藉由Type annotation執行靜態型別檢查,預防錯誤且可以統一規格,增加程式碼的可讀性。

    let type: string

    function type(): number {}

Big Integer: 253 -1 ES2020

H2O