conditional value to key js code example Example: js conditional key const object = { ...bool && { foo: 2 }, }