Memory is managed for you in javascript so you don't really have to worry about it other than making sure you don't use ridiculous amounts of it. When there are no references left to an object or it has gone out of scope, it will be freed by a garbage collector. How it works under the covers is really implementation dependent and not defined by the language.
Even function frames (e.g. local variables) work this way (and not the traditional stack oriented way) which allows for javascript "closures" which are function frames that are not released until no embedded functions have references to them any more.
Javascript code itself is completely machine independent so it's very portable. In practice, the portability of an application typically depends upon the libraries that javascript interacts with (e.g. browser DOM) more so than the language. It's documented by a series of ECMA specifications and there are different version numbers of that specification which define various new features as the language has evolved.
I consider javascript very reliable and, as long as you don't try to use recently introduced features that aren't available in different implementations, there are rarely true javascript issues. There are tons of cross-browser compatibility issues, but those are nearly all NOT in the language itself, but in the browser DOM or the interaction between the language and the DOM.
I'm not sure what you mean by "moduls".
Javascript is an interpreted language so there is no fixed binding between a variable and it's place in memory. All variables are referenced by their name and it's up to the implementation to determine how to best resolve the connection between a name and a specific piece of memory that stores the value.