Object syntax: temp.varname


The temp prefix is a special variable prefix that allows you to mark a variable as "temporary" - that is, one that will be destroyed automatically at the end of the function that it was set in. For this reason, it is not possible to use temp variables as a form of non-volatile storage.

You might use temp variables in combination with while and for, or just for storing temporary information that is no longer required once the function ends (to save memory).


function onCreated()
  temp.variable = "value";

In this example, temp.variable is no longer accessible after the onCreated function is finished.



There are no comments on this page. [Add comment]

Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki