Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Javascript] property instead of method


  • From: geoffreyk at seanet.com (Geoff Knutzen)
  • Subject: [Javascript] property instead of method
  • Date: Wed May 24 11:26:50 2006


>Message: 5
>Date: Wed, 24 May 2006 09:07:43 -0400
>From: Steve Clay <sclay@xxxxxxx>
>Subject: Re: [Javascript] property instead of method
>To: javascript@xxxxxxxxxx
>Message-ID: <107169320.20060524090743@xxxxxxx>
>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 :)