Appending a key value pair to a json object

后端 未结 4 1979
挽巷
挽巷 2020-12-16 00:48

This is the json object I am working with

{
    \"name\": \"John Smith\",
    \"age\": 32,
    \"employed\": true,
    \"address\": {
              


        
4条回答
  •  别那么骄傲
    2020-12-16 01:35

    const newTestJson = JSON.parse(JSON.stringify(testJson));
    newTestJson.collegeId = {"eventno": "6062","eventdesc": "abc"};
    testJson = newTestJson;
    

提交回复
热议问题