Layanan
the truth
01 October 2023

But where does the document
come from? You can say it’s a global variable in JavaScript and, by all means, you would be right. There’s just one thing. We aren’t in JavaScript. Not yet, really. We are looking at some TypeScript code in our IDE. It’d have to be compiled to become JavaScript, land in the browser, and for the browser to expose the document
global to it. So how does TypeScript knows of the document
, its presence, and its methods?