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: Tue May 23 22:07:48 2006

I am trying to make an object that will hold all of the properties of a 
form.
Some of the properties need a bit of manipulation. For example, there are 
two
values and I would like to be able to find the field that has the lowest 
value.

I have been able to create a object that has methods that return the values 
that I want.

var formParams = new Object();
formParams.minValue = function (){
    //calc the lowest value
    return theLowest
}

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

I know there are other ways to do the same thing,
I am using this as a learning experience as well.

Thanks in advance.