how to write conditional statements in a object using if else in javascript code example Example: js conditional object const object = { ...bool && { foo: 2 }, }