2 ms·
axod is right. It's a fallacy to say those are "features of JavaScript," when of course it is really a feature of the runtime environment. JavaScript in a brow
by ahoyhere 17y ago
axod is right. It's a fallacy to say those are "features of JavaScript," when of course it is really a feature of the runtime environment.
JavaScript in a browser runs in the global namespace of the WINDOW, which is defined by the DOM API. Remember that JavaScript, on its own, is a headless language, with no I/O of any kind. It relies on the runtime environment to provide it with scope, context, and i/o, among other things.
Moreover, you can easily "fake" private members/functions/etc by using closures. (Yay!)