Azure / AppConfiguration-JavaScriptProvider

The configuration provider for consuming data in Azure App Configuration from JavaScript applications like Node or browser apps.
https://github.com/Azure/AppConfiguration
MIT License
9 stars 2 forks source link

Adds Additional Undefined Check #104

Closed rossgrambo closed 1 month ago

rossgrambo commented 1 month ago

typeof works great to see if a variable was declared. However the ? operator does not work when the variable was not declared.

For example:

> bad?.foo
Uncaught ReferenceError: bad is not defined
> bad = undefined
undefined
> bad?.foo
undefined

vs

> typeof bad
'undefined'
> bad = undefined
undefined
> typeof bad
'undefined'