var skillTargetID = "1234";
var agentId = "2345";
var firstName = "Ganesh";
var lastName = "Putta";
var userName = "ganesh@gmail.com"
agentjson = {
"refURL": "/unifiedconfig/config/agent/" + skillTargetID + "," + "agentId" + ":" + agentId + "," + "firstName" + ":" + firstName + "," + "lastName" + ":" + lastName + "," + "userName" + ":" + userName
};
console.log(agentjson);
I got a string like below
"refURL":"/unifiedconfig/config/agent/5113","agentId":"1312","firstName":"John","lastName":"Elway","userName":"jelway"
i need to concatenate above string using javascript with dynamic values, i tried, but in the result double quotes are not appending for every word.
agentjson={"refURL":"/unifiedconfig/config/agent/"+skillTargetID+","+"agentId"+":"+agentId+","+"firstName"+":"+firstName+","+"lastName"+":"+lastName+","+"userName"+":"+userName};
this is result i got.
{"refURL": "/unifiedconfig/config/agent/1234,agentId:2345,firstName:Ganesh,lastName:Putta,userName:ganesh@gmail.com"}
how to cancatenate string to get the exact result like first one.