DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR JAVASCRIPT
conditionally add property to object ts
const a = { ...(someCondition && {b: 5}) }
Source by stackoverflow.com #
PREVIOUS
NEXT
Tagged:
#conditionally
#add
#property
#object
#ts
ADD COMMENT
Topic
COMMENT
Name
8+3 =
Submit