Why is window not required in coding in j.s. | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 3

Why is window not required in coding in j.s.

object

10th Oct 2017, 2:42 PM
Android Boi
Android Boi - avatar
3 Antworten
+ 5
Because window is an object like the document. If you make operations you can used: document. createElement('p'); instead of: window. document.createElement('p'); It is easier without writing window.
10th Oct 2017, 3:50 PM
David
David - avatar
+ 2
Cause browser will add "window" to every variable automatically.
10th Oct 2017, 4:43 PM
Sergey Gromkov
Sergey Gromkov - avatar
+ 2
yes I also figured out windows is a top level object...so it mustn't be added in every j.s code
11th Oct 2017, 2:14 PM
Android Boi
Android Boi - avatar