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

Container筆記 - K8s

Container筆記 - K8s

前言&第一天記錄

前言&第一天記錄

Web開發學習筆記01—Primitive type v.s. Object type

Web開發學習筆記01—Primitive type v.s. Object type


Comments