How to merge 2 object in javascript

This question already has an answer here:

  • How can I add new array elements at the beginning of an array in JavaScript? 6 answers

  •   response = {
        "data": [
        {
          "id": "203",
          "bench": "abc"
        },
        {
          "id": "205",
          "bench": "def"
        }
        ],
        "responseCode": 200,
        "isSuccess": "true"
      };
    
      response.data.unshift({
        "id": "0",
        "bench": "Select bench"
      });
      console.log(response); // shows json object
    
    链接地址: http://www.djcxy.com/p/19364.html

    上一篇: 如何在ui顶部添加新节点

    下一篇: 如何在javascript中合并2个对象