Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting a string "JS Bin Output" instead of undefined #3477

Closed
Gaya3G opened this issue Oct 27, 2021 · 1 comment
Closed

Getting a string "JS Bin Output" instead of undefined #3477

Gaya3G opened this issue Oct 27, 2021 · 1 comment

Comments

@Gaya3G
Copy link

Gaya3G commented Oct 27, 2021

Below code logs "JS Bin Output" instead of undefined.

var name;
console.log(name);
@Gaya3G Gaya3G changed the title Getting a string instead of undefined Getting a string "JS Bin Output" instead of undefined Oct 27, 2021
@remy
Copy link
Member

remy commented Oct 27, 2021

name actually contains window.name which in the case of the output panel, the iframe actually does have a name value.

It's a long standing weird global variable, here's some backstory too: https://remysharp.com/2021/01/21/that-other-global-name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants