📌  相关文章
📜  将键分配给具有相同名称的对象 - 无论代码示例

📅  最后修改于: 2022-03-11 14:55:53.243000             🧑  作者: Mango

代码示例1
let name = 'bob';let age = 34;let job = 'carpenter';// instead of thislet myObject1 = { name: name, age: age, job: job };// do thislet myObject2 = { name, age, job };console.log(myObject2);--> { name: 'bob', age: 34, job: 'carpenter' }