[Javascript] property instead of method

Steve Clay sclay at ufl.edu
Wed May 24 08:07:43 CDT 2006


Tuesday, May 23, 2006, 10:50:30 PM, Geoff Knutzen wrote:
> This works and gives me easy access like this
> x = formParams.minValue();

> Is there a way to make minValue a propery instead of a method
> so I can get the value this way
> x = formParams.minValue

x = formParams.minValue;
x = x();

OK, that's cheating ;) A property is just a variable, so you have to set it
somewhere; it can't magically change without assistance. If you wanted to
turn minValue into a property, you'd need to run the calculation code
/somewhere else/ to update it.

What's wrong with calling it as a method?

Steve
-- 
http://mrclay.org/




More information about the Javascript mailing list