[Javascript] property instead of method

Geoff Knutzen geoffreyk at seanet.com
Wed May 24 11:26:45 CDT 2006



>Message: 5
>Date: Wed, 24 May 2006 09:07:43 -0400
>From: Steve Clay <sclay at ufl.edu>
>Subject: Re: [Javascript] property instead of method
>To: javascript at LaTech.edu
>Message-ID: <107169320.20060524090743 at ufl.edu>
>Content-Type: text/plain; charset=us-ascii
>
>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/

Nothing wrong with calling it as a method. That is probably what I will end
up doing. I was just wondering if there was a way that I was not familiar
with to make this a property. 

Just trying to learn a bit. And cheat if I must :)







More information about the Javascript mailing list