I am trying to create a json which contains a key value pair where the value is generated based on a concatenation of another two variables(strings).
Apart from concatenating like,
var a = "A";
var b = "B";
var c = a+" "+b;
and using variable 'c' directly, is there a way to append variables within the key value as below.
var fName = "Test1";
var lName = "Test2";
var json = {"fname":fname,"lname":lName,"fullname":"'fName'+' '+'lname'"}
I expect to result {"fname":"Test1","lname":"Test2","fullname":"Test1 Test2"}
Please let me know if this is possible to achieve.