There is some confusion between the "old by reference" used in Pascal and C in some cases, and "by reference" in java, javascript and the latest programming languages.
A value is passed in javascript, and that value is a reference to an object. This means that you can change the object after this link, but not change the link itself.
If you need to do this in a method, you need to do it "explicitly", for example:
this.nullMe("underlyingReference"); this.nullMe = function(name) { this[name] = null; }
But it's a bit, well, over-engineering to have a way to set null :)
source share