add new element to existing json javascript code example
Example 1: add new element to existing json object
json = JSON.stringify(jsObj);
console.log(json)
Example 2: javascript append to existing json
let test = {
name: 'NN',
email: '[email protected]'
};
test.phone = '234654234';
// result { "name": "NN", "email": "[email protected]", "phone": "234654234" }