Hello;
How is Registry = { } used here, below. In other words what is this statement doing in this function;
function registerPerson(firstName, lastName)
{
var date = new Date(),
counter = 0, registry = {},
output;
CEHJ, I read the info at the link you provided, and the answer is not there. Did you understand my question? I had googled it, and of course most of the findings were about the MS OS registry.
I do not understand what this statement is doing; registry = {},
Obviously the registry variable is getting information from the registry, but what and why?
I stand corrected - sorry. 'empty object' it is, my bad. In fact the original article reference does go on to explicitly set registry to null:
// locals
date =
counter =
registry = null;
return output;
I hope the point is not lost though that there really is no great significance in registry = {} it is really just an example the author has used to reach a conclusion about garbage collection.
chima
ASKER
PortletPaul and Kravimir, so the word registry could have been any variable name, the point here is that it created an "empty object." This empty object by using {} has properties and methods that could cause memory leaks, hence setting it to null, ensuring that the garbage collection will grab it.