re: The shortest way to conditional insert properties into an object literal VIEW POST


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


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

Code of Conduct Report abuse