Code won't show under 'windows' global object in developer tools


#1

Hello! I was taking a JS course on Udemya (JS: Understanding the Weird Parts) and one the examples I was following along had us write out some basic code and look at how it impacted developer tools.

This was the code in the text editor:
var a = 'Hello World!'
function b(){
}

I expected to see the variable ‘a’ and empty function ‘b’ show up under the windows object but could not find it anywhere.

This was what I expected to see and was created by using a different text editor:

I’m new to programming and using text editors so go easy on me lol

Thanks!


#2

You are showing the result of running this code, right? I don’t see where that has anything to do with the editor itself.


#3

The result of the code is different between the two editors I used (brackets and Atom). The code’s output worked as expected with brackets but when I was using Atom instead (with the same code) there was no output in dev tools. I presumed this is an editor issue since the code wasn’t the problem (code worked fine with brackets editor).


#4

But neither Brackets nor Atom compile code. There is no “result”. They just manipulate text. Your workflow must be different in the two cases.

Are you using an Atom package to compile code as part of your workflow? If so then this is a problem with the package and you should issue a report in that repo.


#5

Oh, maybe I understand. Brackets might also be a compiler. Atom isn’t. That would account for the difference you are referring to.