ReferenceError ("...not defined") vs "undefined" in example
See original GitHub issueChallenge Name
Issue Description
The example (see the screenshot below) states that console.log(loc)
called outside the body of myTest()
will result in "undefined"
, i.e. a string. That is not accurate, as that will actually throw a ReferenceError (loc is not defined
) exception instead of outputting the "undefined"
string.
Screenshot
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
Explain the difference between undefined and not defined in ...
not defined : In JavaScript, it is one of the reference errors that JavaScript will throw when someone accesses the variable which is...
Read more >What is the difference between Uncaught ReferenceError and ...
This creates "Uncaught ReferenceError: a is not defined". In both cases a is undefined, and the console tells you that.
Read more >What is difference between Undefined and Not Defined in JS?
A not defined is a variable which is not declared at a given point of time with declaration keyword like var, let or...
Read more >ReferenceError: "x" is not defined - JavaScript - MDN Web Docs
The JavaScript exception "variable is not defined" occurs when there is a non-existent variable referenced somewhere.
Read more >The difference between undefined, not defined, and null in ...
JavaScript has two types of values, null and undefined, that represent an empty variable. Both are primitive data types and are falsy values ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ooade @no-stack-dub-sack Sure, I’ll do it.
Hi. If @nomicos is not doing this issue, can I try it out?