title: JSON Object Modification in JavaScript
body: <p>Can someone help me modifying the JSON Object using javascript, Currently I am using angular js and getting the JSON data from the file. But i want to modify the below JSON and process accordingly.</p>
  
  <p><strong>Current JSON</strong></p>
  
  <pre><code>{
    "account": {
      "premise": {
        "zone": [
          {
            "id": 1,
            "name": "Tps John?!? \"':7",
            "type": "DOOR",
            "functionType": "ENTRY_EXIT",
            "sensor": [
              {
                "id": 1,
                "type": "DRY_CONTACT",
                "sourceType": "ZIGBEE",
                "serialNumber": "000d6f00030cdbcf.1",
                "model": "MCT-320 SMA",
                "manufacturer": "Visonic",
                "firmwareVersion": "0x00040008",
                "hardwareVersion": "1"
              }
            ]
          },
          {
            "id": 2,
            "name": "Motion Sensor $-*9$+%;47$9 %;:?2",
            "type": "MOTION",
            "functionType": "INTERIOR_FOLLOWER",
            "sensor": [
              {
                "id": 2,
                "type": "MOTION",
                "sourceType": "ZIGBEE",
                "serialNumber": "000d6f0004b2af93.1",
                "model": "NEXT K85 SMA",
                "manufacturer": "Visonic",
                "firmwareVersion": "0x0004000b",
                "hardwareVersion": "1"
              }
            ]
          }
        ]
      }
    }
  }
  </code></pre>
  
  <p>But From above JSON in the zone object have Sensor Object , but i want to keep only Sensor as below</p>
  
  <pre><code>{
    "account": {
      "premise": {
        "sensor": [
          {
            "id": 1,
            "type": "DRY_CONTACT",
            "sourceType": "ZIGBEE",
            "serialNumber": "000d6f00030cdbcf.1",
            "model": "MCT-320 SMA",
            "manufacturer": "Visonic",
            "firmwareVersion": "0x00040008",
            "hardwareVersion": "1"
          },
          {
            "id": 2,
            "type": "MOTION",
            "sourceType": "ZIGBEE",
            "serialNumber": "000d6f0004b2af93.1",
            "model": "NEXT K85 SMA",
            "manufacturer": "Visonic",
            "firmwareVersion": "0x0004000b",
            "hardwareVersion": "1"
          }
        ]
      }
    }
  }
  </code></pre>