question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ReferenceError ("...not defined") vs "undefined" in example

See original GitHub issue

Challenge Name

Local Scopes and Functions

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

image

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
nomicoscommented, Jan 18, 2017

@ooade @no-stack-dub-sack Sure, I’ll do it.

0reactions
IanTeocommented, Jan 18, 2017

Hi. If @nomicos is not doing this issue, can I try it out?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found