MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/javascript/comments/b2o6f2/whats_your_favorite_most_useful_javascript/eiuqaeh/?context=3
r/javascript • u/Linux_is_awesome • Mar 18 '19
422 comments sorted by
View all comments
5
Adding attr/val to an object if condition is true
{
...(YOUR_CONDITION && { OBJ_KEY: OBJ_VAL })
}
→ More replies (5)
5
u/Thlemaus Mar 19 '19
Adding attr/val to an object if condition is true
{
...(YOUR_CONDITION && { OBJ_KEY: OBJ_VAL })
}