ES6 新功能


Posted by Rich on 2021-04-25

let name = rich
console.log(`hello ${name}`)
//output: hello rich
var  obj = {
    a:1,
    b:2
}
var obj2 = {
    ...obj,   ///destructuring
    c: 3
}
var {a, ...rest} = obj2 //rest parameters
console.log(rest)
//output:{b: 2, c: 3}









Related Posts

Day 48 - Selenium & Cookie Click Game

Day 48 - Selenium & Cookie Click Game

VUE3 課前章節-JS 必備觀念-ES6縮寫

VUE3 課前章節-JS 必備觀念-ES6縮寫

筆記、[ALG101] 看程式

筆記、[ALG101] 看程式


Comments