📅  最后修改于: 2022-03-11 15:02:37.335000             🧑  作者: Mango
const trueCondition = true;const falseCondition = false;const obj = { ...(trueCondition && { dogs: "woof" }), ...(falseCondition && { cats: "meow" }),};// { dogs: 'woof' }