get an object from conditional key value es6 code example Example: js conditional object key const object = { ...bool && { foo: 2 }, }