Possible Duplicate:
How do I dynamically call a JavaScript object’s method
I have function for different properties
setCar : function() {}
setBike : function() {}
setAirPlane : function (){}
I have object in format key value
var json = { Car : "Car1",
Bike : "Bike1",
AirPlane : "test1" }
I want to call to the set function in dynamic way according to the object values:
updateProperties : function(json) {
for ( var property in json) {
//set + property (AdditionalProperties[property])
};
in the property I have the name of the function(Car,Bike,AirPlane) and in AdditionalProperties[property] I have the value of the property ( Car1,Bike1,test1.
Is it possible to do it ?