I have a JSON object with this structure:
{"Firstname":"john","Lastname":"doe"}
How do it change it to an array with this structure with the name 'abc'(?):
users: [{"Firstname":"john","Lastname":"doe"}]
This is I'm building my object from input values:
var obj = {};
obj.Firstname = document.getElementById("firstName").value;
obj.Lastname = document.getElementById("surname").value;
console.log(obj);
var jsonStringObj = JSON.stringify(obj);
console.log(jsonStringObj );
which returns:
{"Firstname":"john","Lastname":"doe"}
thanks!