You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Chapter 7 says:
"
If you're checking to see if an variable has been defined, you'll still need to use typeof otherwise you'll get a ReferenceError.
if typeof aVar isnt "undefined"
objectType = type(aVar)
Or more succinctly with the existential operator:
objectType = type(aVar?)
"
However, the two statements are NOT equivalent, because type(aVar?) will unconditionally return "boolean", because applying the existential operator to a variable always returns a Boolean.
The text was updated successfully, but these errors were encountered:
Chapter 7 says:
"
If you're checking to see if an variable has been defined, you'll still need to use typeof otherwise you'll get a ReferenceError.
Or more succinctly with the existential operator:
"
However, the two statements are NOT equivalent, because
type(aVar?)
will unconditionally return"boolean"
, because applying the existential operator to a variable always returns a Boolean.The text was updated successfully, but these errors were encountered: