标签:结构 char 默认 ora fat efi let define code
const Tom={
name:‘Tom‘,
age:20,
family:{
mother:‘Norah Jones‘,
father:‘Richard Jones‘,
brother:‘Howard Jones‘,
}
}
//之前已经声明了的时候
let name
({name ,age}=Tom)
const {mother,father: baba,grandma}=Tom.family //grandma undefined
//如果没属性,给默认值
const {brother,son="have no son"}=Tom.family
//如果有son,默认值不为undefined,默认值不会生效
标签:结构 char 默认 ora fat efi let define code
原文地址:https://www.cnblogs.com/HKUI/p/13118236.html