function createObject(arg1, arg2){
var object = {};
object.arg1 = arg2;
}
I am calling my function like this.
createObject('name', objectproperties);
The problem i am facing is when the request object is formed. Its something like this
{"arg1":{"Properties":"Value"}}
I want my object to be formed like this. Its a generic class, which i am creating for many requests to be formed.
{"name":{"Properties":"Value"}}
Use square bracket notation:
Reference: http://www.jibbering.com/faq/faq_notes/square_brackets.html#vId