[Javascript] property instead of method

Geoff Knutzen geoffreyk at seanet.com
Tue May 23 21:50:30 CDT 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. 





More information about the Javascript mailing list