JavaScript is great because it is so simple.
How is it so simple? well, because it isn't needlessly complex!
A great example is that nested scopes, prototype chains, and node modules, all work in a precisely similar way.
If you refer to a variable in a nested scope, the interpereter checks if it is defined in that scope, then in the outer scope, recursively.
This makes it easy to shadow data.
Prototype chains work exactly the same!
If you refer to a property of an object, the interpereter checks if it is defined on that object, then on the prototype object, recursively.
Those two sentences where very similar!
Scopes differ from prototypes because you can lengthen the prototype chain after the fact with prototypes, but in scopes the structure of the scope-chain is hard-coded.
Now, with modules:
If you require a (non-relative) module X, the interpereter checks if it is defined in
./node_modules/X
, then in parent directories../node_modules/X
, recursively.
In most languages, these are three different areas that you need to understand seperately. In nodejs/javascript, although the surface features differ, the core rules that these follow are identical.
That makes for a simple, powerful language.