es6 conditionally add property to object code example Example: conditionally add property to object ts const a = { ...(someCondition && {b: 5}) }