I have a JSON object with few properties How Do I add properties dynamically to the object?
person({
'name':Ajay,
'age':21 });
If i want to add properties like gender or contact to this existing object , how to do it?
I suppose you have function named as person and you are sending a object in that function So to put it simple.
var obj={"name":"Ajay",
"age":"21"
};
person(obj);
If you want to add more properties to your obj. You can do it like this:
obj.sex="Male";
obj.height="6";
person(obj);
scripting languageyou are supporting. Without it anybody would be handicapped to answer.