DEV Community

Discussion on: The shortest way to conditional insert properties into an object literal

Collapse
 
felixfbecker profile image
Felix Becker

In most cases, just defaulting the property value to undefined is the easier choice.

Collapse
 
bobmyers profile image
Bob Myers

In the case of Firebase, to take one example, a value of undefined is treated differently than a missing property, and causes an error.