Arrays 更新单个元素后JSON数组上的错误

Arrays 更新单个元素后JSON数组上的错误,arrays,json,Arrays,Json,这是一个场景 HTML 剧本 var requestedItemsCache=[ { "DetailID":40085, "PRNo":33420, "Total":31400, "Justification":null, "SAPAssetCode":null, "InventoryDetails":null, "DeliveryDate":null, "DeploymentDat

这是一个场景

HTML


剧本

var requestedItemsCache=[  
   {  
      "DetailID":40085,
      "PRNo":33420,
      "Total":31400,
      "Justification":null,
      "SAPAssetCode":null,
      "InventoryDetails":null,
      "DeliveryDate":null,
      "DeploymentDate":null,
      "CurrentApproverID":null,
      "CurrentApproval":false,
      "Specification":null,
      "StockID":null,
      "QuotedPrice":null,
      "QuotedTotalPrice":null,
      "PONo":null,
      "Remarks":"For PO",
      "DeptStockID":null,
      "Confirmation":null,
      "Flag":0,
      "ApprovalFlag":0,
      "SerialNo":null,
      "SubItems":[  
         {  
            "DetailID":40086,
            "PRNo":33420,
            "Total":0,
            "Justification":null,
            "SAPAssetCode":null,
            "InventoryDetails":null,
            "DeliveryDate":null,
            "DeploymentDate":null,
            "CurrentApproverID":null,
            "CurrentApproval":false,
            "Specification":null,
            "StockID":null,
            "QuotedPrice":null,
            "QuotedTotalPrice":null,
            "PONo":null,
            "Remarks":"For PO",
            "DeptStockID":null,
            "Confirmation":null,
            "Flag":0,
            "ApprovalFlag":0,
            "SerialNo":null,
            "SubItems":null,
            "ParentID":null,
            "ItemID":1051,
            "ItemDescription":"CPU Core i3, HDD 500GB SATA,  RAM 4GB, Windows 7 Professional, 64-bit",
            "Price":0,
            "ItemCatSubID":1063,
            "SubCategoryName":"Peripherals & Accessories",
            "Brand":"Lenovo",
            "Model":"Thinkcentre M72e",
            "Unit":null,
            "UnitID":0,
            "ItemHeaderID":1023,
            "GenericName":"CPU",
            "ItemCatID":0,
            "Quantity":1,
            "IsActive":0,
            "IsComponent":0,
            "isAsset":1,
            "SubCatalogs":null
         },
         {  
            "DetailID":40087,
            "PRNo":33420,
            "Total":0,
            "Justification":null,
            "SAPAssetCode":null,
            "InventoryDetails":null,
            "DeliveryDate":null,
            "DeploymentDate":null,
            "CurrentApproverID":null,
            "CurrentApproval":false,
            "Specification":null,
            "StockID":null,
            "QuotedPrice":null,
            "QuotedTotalPrice":null,
            "PONo":null,
            "Remarks":"For PO",
            "DeptStockID":null,
            "Confirmation":null,
            "Flag":0,
            "ApprovalFlag":0,
            "SerialNo":null,
            "SubItems":null,
            "ParentID":null,
            "ItemID":1052,
            "ItemDescription":"LCD Monitor LCD Display 19” ",
            "Price":0,
            "ItemCatSubID":1063,
            "SubCategoryName":"Peripherals & Accessories",
            "Brand":"Lenovo",
            "Model":"ThinkVision L197Wa",
            "Unit":null,
            "UnitID":0,
            "ItemHeaderID":1019,
            "GenericName":"Monitor",
            "ItemCatID":0,
            "Quantity":1,
            "IsActive":0,
            "IsComponent":0,
            "isAsset":1,
            "SubCatalogs":null
         },
         {  
            "DetailID":40088,
            "PRNo":33420,
            "Total":0,
            "Justification":null,
            "SAPAssetCode":null,
            "InventoryDetails":null,
            "DeliveryDate":null,
            "DeploymentDate":null,
            "CurrentApproverID":null,
            "CurrentApproval":false,
            "Specification":null,
            "StockID":null,
            "QuotedPrice":null,
            "QuotedTotalPrice":null,
            "PONo":null,
            "Remarks":"For PO",
            "DeptStockID":null,
            "Confirmation":null,
            "Flag":0,
            "ApprovalFlag":0,
            "SerialNo":null,
            "SubItems":null,
            "ParentID":null,
            "ItemID":1053,
            "ItemDescription":"Keyboard Qwerty, USB",
            "Price":0,
            "ItemCatSubID":1063,
            "SubCategoryName":"Peripherals & Accessories",
            "Brand":"Lenovo",
            "Model":"SK-8820",
            "Unit":null,
            "UnitID":0,
            "ItemHeaderID":1018,
            "GenericName":"Keyboard",
            "ItemCatID":0,
            "Quantity":1,
            "IsActive":0,
            "IsComponent":0,
            "isAsset":1,
            "SubCatalogs":null
         },
         {  
            "DetailID":40089,
            "PRNo":33420,
            "Total":0,
            "Justification":null,
            "SAPAssetCode":null,
            "InventoryDetails":null,
            "DeliveryDate":null,
            "DeploymentDate":null,
            "CurrentApproverID":null,
            "CurrentApproval":false,
            "Specification":null,
            "StockID":null,
            "QuotedPrice":null,
            "QuotedTotalPrice":null,
            "PONo":null,
            "Remarks":"For PO",
            "DeptStockID":null,
            "Confirmation":null,
            "Flag":0,
            "ApprovalFlag":0,
            "SerialNo":null,
            "SubItems":null,
            "ParentID":null,
            "ItemID":1054,
            "ItemDescription":"Mouse Optical, USB ",
            "Price":0,
            "ItemCatSubID":1063,
            "SubCategoryName":"Peripherals & Accessories",
            "Brand":"Lenovo",
            "Model":"LXB MO28UOA ",
            "Unit":null,
            "UnitID":0,
            "ItemHeaderID":1016,
            "GenericName":"Mouse",
            "ItemCatID":0,
            "Quantity":1,
            "IsActive":0,
            "IsComponent":0,
            "isAsset":1,
            "SubCatalogs":null
         }
      ],
      "ParentID":null,
      "ItemID":1016,
      "ItemDescription":"Lenovo Desktop; Office Worker 1 as General User Core i3, HDD 500GB SATA,  RAM 4GB, LCD Display 20”, Windows 7 Professional, 64-bit, CPU Warranty 5/5/5, Monitor Warranty 3/3/3",
      "Price":31400,
      "ItemCatSubID":1061,
      "SubCategoryName":"Computers",
      "Brand":"Lenovo",
      "Model":"Thinkcentre M72e",
      "Unit":null,
      "UnitID":0,
      "ItemHeaderID":1001,
      "GenericName":"Desktop for Office Worker 1 (General User)",
      "ItemCatID":0,
      "Quantity":1,
      "IsActive":0,
      "IsComponent":1,
      "isAsset":1,
      "SubCatalogs":null
   }
];

var additionalData={"ItemID":1016,"ItemDescription":"Core i3, HDD 500GB SATA,  RAM 4GB, LCD Display 20”, Windows 7 Professional, 64-bit, CPU Warranty 5/5/5, Monitor Warranty 3/3/3","Price":31400,"ItemCatSubID":1061,"SubCategoryName":"Computers","Brand":"Lenovo","Model":"Thinkcentre M72e","Unit":"Unit","UnitID":478,"ItemHeaderID":1001,"GenericName":"Desktop for Office Worker 1 (General User)","ItemCatID":1001,"Quantity":1,"IsActive":1,"IsComponent":1,"isAsset":1,"SubCatalogs":[{"ItemID":1051,"ItemDescription":"Core i3, HDD 500GB SATA,  RAM 4GB, Windows 7 Professional, 64-bit","Price":27500,"ItemCatSubID":1063,"SubCategoryName":"Peripherals & Accessories","Brand":"Lenovo","Model":"Thinkcentre M72e","Unit":"Unit","UnitID":478,"ItemHeaderID":1023,"GenericName":"CPU","ItemCatID":1001,"Quantity":1,"IsActive":1,"IsComponent":0,"isAsset":1,"SubCatalogs":null},{"ItemID":1052,"ItemDescription":"LCD Display 19” ","Price":0,"ItemCatSubID":1063,"SubCategoryName":"Peripherals & Accessories","Brand":"Lenovo","Model":"ThinkVision L197Wa","Unit":"Unit","UnitID":478,"ItemHeaderID":1019,"GenericName":"Monitor","ItemCatID":1001,"Quantity":1,"IsActive":1,"IsComponent":0,"isAsset":1,"SubCatalogs":null},{"ItemID":1053,"ItemDescription":"Qwerty, USB","Price":0,"ItemCatSubID":1063,"SubCategoryName":"Peripherals & Accessories","Brand":"Lenovo","Model":"SK-8820","Unit":"Unit","UnitID":478,"ItemHeaderID":1018,"GenericName":"Keyboard","ItemCatID":1001,"Quantity":1,"IsActive":1,"IsComponent":0,"isAsset":1,"SubCatalogs":null},{"ItemID":1054,"ItemDescription":"Optical, USB ","Price":600,"ItemCatSubID":1063,"SubCategoryName":"Peripherals & Accessories","Brand":"Lenovo","Model":"LXB MO28UOA ","Unit":"Unit","UnitID":478,"ItemHeaderID":1016,"GenericName":"Mouse","ItemCatID":1001,"Quantity":1,"IsActive":1,"IsComponent":0,"isAsset":1,"SubCatalogs":null}],"Flag":1000,"ApprovalFlag":1,"Total":31400,"SubItems":null};


requestedItemsCache.push(additionalData);
requestedItemsCache.push(additionalData);
requestedItemsCache.push(additionalData);

var x=document.getElementById("output");

/*RENDER ORIGINAL SCHEMA*/
x.innerHTML = "Original Value : " + x.innerHTML + requestedItemsCache[0].Flag + "<br/>";

requestedItemsCache[0].Flag=2000;
x.innerHTML = x.innerHTML+ "Update Value : "  + requestedItemsCache[0].Flag + "<br/><br/> THIS IS OK! </br/><br/>";



/*ORIGINAL VALUE*/
x.innerHTML =x.innerHTML+"Original Value Index 1 : " +(requestedItemsCache[1].Flag) + "<br/>";
x.innerHTML =x.innerHTML+"Original Value Index 2 : " +(requestedItemsCache[2].Flag) + "<br/>";
x.innerHTML =x.innerHTML+"Original Value Index 3: " +(requestedItemsCache[3].Flag) + "<br/><br/><br/";

/*BUG IN UPDATING JSON OBJECT*/
x.innerHTML = x.innerHTML+ " Update element at index 1" + "<br/><br/><br/>";

requestedItemsCache[3].Flag=3000;

x.innerHTML =x.innerHTML+"Updated Value Index 1 : " +(requestedItemsCache[1].Flag) + "<br/>";
x.innerHTML =x.innerHTML+"Updated Value Index 2 : " +(requestedItemsCache[2].Flag) + "<br/>";
x.innerHTML =x.innerHTML+"Updated Value Index 3: " +(requestedItemsCache[3].Flag) + "<br/>";

console.log(requestedItemsCache[1].Flag);
console.log(requestedItemsCache[2].Flag);
console.log(requestedItemsCache[3].Flag);
var requestedItemsCache=[
{  
“详细ID”:40085,
“PRNo”:33420,
“总数”:31400,
“理由”:空,
“SAPAssetCode”:空,
“InventoryDetails”:空,
“交货日期”:空,
“DeploymentDate”:空,
“CurrentApproverID”:空,
“当前批准”:错误,
“规范”:空,
“StockID”:空,
“报价价格”:空,
“QuotedTotalPrice”:空,
“PONo”:空,
“备注”:“对于PO”,
“DeptStockID”:空,
“确认”:空,
“标志”:0,
“ApprovalFlag”:0,
“SerialNo”:空,
“分项”:[
{  
“DetailID”:40086,
“PRNo”:33420,
“总计”:0,
“理由”:空,
“SAPAssetCode”:空,
“InventoryDetails”:空,
“交货日期”:空,
“DeploymentDate”:空,
“CurrentApproverID”:空,
“当前批准”:错误,
“规范”:空,
“StockID”:空,
“报价价格”:空,
“QuotedTotalPrice”:空,
“PONo”:空,
“备注”:“对于PO”,
“DeptStockID”:空,
“确认”:空,
“标志”:0,
“ApprovalFlag”:0,
“SerialNo”:空,
“子项”:空,
“ParentID”:空,
“项目ID”:1051,
“项目描述”:“CPU核心i3,硬盘500GB SATA,RAM 4GB,Windows 7 Professional,64位”,
“价格”:0,
“ItemCatSubID”:1063,
“子类别名称”:“外围设备和附件”,
“品牌”:“联想”,
“型号”:“Thinkcentre M72e”,
“单位”:空,
“UnitID”:0,
“ItemHeaderID”:1023,
“通用名称”:“CPU”,
“ItemCatID”:0,
“数量”:1,
“IsActive”:0,
“IsComponent”:0,
“isAsset”:1,
“子类别”:空
},
{  
“DetailID”:40087,
“PRNo”:33420,
“总计”:0,
“理由”:空,
“SAPAssetCode”:空,
“InventoryDetails”:空,
“交货日期”:空,
“DeploymentDate”:空,
“CurrentApproverID”:空,
“当前批准”:错误,
“规范”:空,
“StockID”:空,
“报价价格”:空,
“QuotedTotalPrice”:空,
“PONo”:空,
“备注”:“对于PO”,
“DeptStockID”:空,
“确认”:空,
“标志”:0,
“ApprovalFlag”:0,
“SerialNo”:空,
“子项”:空,
“ParentID”:空,
“项目ID”:1052,
“项目描述”:“液晶显示器液晶显示器19”“,
“价格”:0,
“ItemCatSubID”:1063,
“子类别名称”:“外围设备和附件”,
“品牌”:“联想”,
“模型”:“ThinkVision L197Wa”,
“单位”:空,
“UnitID”:0,
“ItemHeaderID”:1019,
“GenericName”:“监视器”,
“ItemCatID”:0,
“数量”:1,
“IsActive”:0,
“IsComponent”:0,
“isAsset”:1,
“子类别”:空
},
{  
“DetailID”:40088,
“PRNo”:33420,
“总计”:0,
“理由”:空,
“SAPAssetCode”:空,
“InventoryDetails”:空,
“交货日期”:空,
“DeploymentDate”:空,
“CurrentApproverID”:空,
“当前批准”:错误,
“规范”:空,
“StockID”:空,
“报价价格”:空,
“QuotedTotalPrice”:空,
“PONo”:空,
“备注”:“对于PO”,
“DeptStockID”:空,
“确认”:空,
“标志”:0,
“ApprovalFlag”:0,
“SerialNo”:空,
“子项”:空,
“ParentID”:空,
“项目ID”:1053,
“项目描述”:“键盘Qwerty,USB”,
“价格”:0,
“ItemCatSubID”:1063,
“子类别名称”:“外围设备和附件”,
“品牌”:“联想”,
“型号”:“SK-8820”,
“单位”:空,
“UnitID”:0,
“ItemHeaderID”:1018,
“通用名称”:“键盘”,
“ItemCatID”:0,
“数量”:1,
“IsActive”:0,
“IsComponent”:0,
“isAsset”:1,
“子类别”:空
},
{  
“DetailID”:40089,
“PRNo”:33420,
“总计”:0,
“理由”:空,
“SAPAssetCode”:空,
“InventoryDetails”:空,
“交货日期”:空,
“DeploymentDate”:空,
“CurrentApproverID”:空,
“当前批准”:错误,
“规范”:空,
“StockID”:空,
“报价价格”:空,
“QuotedTotalPrice”:空,
“PONo”:空,
“备注”:“对于PO”,
“DeptStockID”:空,
“确认”:空,
“标志”:0,
“ApprovalFlag”:0,
“SerialNo”:空,
“子项”:空,
“ParentID”:空,
“项目ID”:1054,
“项目描述”:“鼠标光学,USB”,
“价格”:0,
“ItemCatSubID”:1063,
“子类别名称”:“外围设备和附件”,
“品牌”:“联想”,
“型号”:“LXB MO28UOA”,
“单位”:空,
“UnitID”:0,
“ItemHeaderID”:1016,
“通用名称”:“鼠标”,
“ItemCatID”:0,
“数量”:1,
“IsActive”:0,
“IsComponent”:0,
“isAsset”:1,
“子类别”:空
}
],
“ParentID”:空,
“项目ID”:1016,
“项目描述
var requestedItemsCache=[  
   {  
      "DetailID":40085,
      "PRNo":33420,
      "Total":31400,
      "Justification":null,
      "SAPAssetCode":null,
      "InventoryDetails":null,
      "DeliveryDate":null,
      "DeploymentDate":null,
      "CurrentApproverID":null,
      "CurrentApproval":false,
      "Specification":null,
      "StockID":null,
      "QuotedPrice":null,
      "QuotedTotalPrice":null,
      "PONo":null,
      "Remarks":"For PO",
      "DeptStockID":null,
      "Confirmation":null,
      "Flag":0,
      "ApprovalFlag":0,
      "SerialNo":null,
      "SubItems":[  
         {  
            "DetailID":40086,
            "PRNo":33420,
            "Total":0,
            "Justification":null,
            "SAPAssetCode":null,
            "InventoryDetails":null,
            "DeliveryDate":null,
            "DeploymentDate":null,
            "CurrentApproverID":null,
            "CurrentApproval":false,
            "Specification":null,
            "StockID":null,
            "QuotedPrice":null,
            "QuotedTotalPrice":null,
            "PONo":null,
            "Remarks":"For PO",
            "DeptStockID":null,
            "Confirmation":null,
            "Flag":0,
            "ApprovalFlag":0,
            "SerialNo":null,
            "SubItems":null,
            "ParentID":null,
            "ItemID":1051,
            "ItemDescription":"CPU Core i3, HDD 500GB SATA,  RAM 4GB, Windows 7 Professional, 64-bit",
            "Price":0,
            "ItemCatSubID":1063,
            "SubCategoryName":"Peripherals & Accessories",
            "Brand":"Lenovo",
            "Model":"Thinkcentre M72e",
            "Unit":null,
            "UnitID":0,
            "ItemHeaderID":1023,
            "GenericName":"CPU",
            "ItemCatID":0,
            "Quantity":1,
            "IsActive":0,
            "IsComponent":0,
            "isAsset":1,
            "SubCatalogs":null
         },
         {  
            "DetailID":40087,
            "PRNo":33420,
            "Total":0,
            "Justification":null,
            "SAPAssetCode":null,
            "InventoryDetails":null,
            "DeliveryDate":null,
            "DeploymentDate":null,
            "CurrentApproverID":null,
            "CurrentApproval":false,
            "Specification":null,
            "StockID":null,
            "QuotedPrice":null,
            "QuotedTotalPrice":null,
            "PONo":null,
            "Remarks":"For PO",
            "DeptStockID":null,
            "Confirmation":null,
            "Flag":0,
            "ApprovalFlag":0,
            "SerialNo":null,
            "SubItems":null,
            "ParentID":null,
            "ItemID":1052,
            "ItemDescription":"LCD Monitor LCD Display 19” ",
            "Price":0,
            "ItemCatSubID":1063,
            "SubCategoryName":"Peripherals & Accessories",
            "Brand":"Lenovo",
            "Model":"ThinkVision L197Wa",
            "Unit":null,
            "UnitID":0,
            "ItemHeaderID":1019,
            "GenericName":"Monitor",
            "ItemCatID":0,
            "Quantity":1,
            "IsActive":0,
            "IsComponent":0,
            "isAsset":1,
            "SubCatalogs":null
         },
         {  
            "DetailID":40088,
            "PRNo":33420,
            "Total":0,
            "Justification":null,
            "SAPAssetCode":null,
            "InventoryDetails":null,
            "DeliveryDate":null,
            "DeploymentDate":null,
            "CurrentApproverID":null,
            "CurrentApproval":false,
            "Specification":null,
            "StockID":null,
            "QuotedPrice":null,
            "QuotedTotalPrice":null,
            "PONo":null,
            "Remarks":"For PO",
            "DeptStockID":null,
            "Confirmation":null,
            "Flag":0,
            "ApprovalFlag":0,
            "SerialNo":null,
            "SubItems":null,
            "ParentID":null,
            "ItemID":1053,
            "ItemDescription":"Keyboard Qwerty, USB",
            "Price":0,
            "ItemCatSubID":1063,
            "SubCategoryName":"Peripherals & Accessories",
            "Brand":"Lenovo",
            "Model":"SK-8820",
            "Unit":null,
            "UnitID":0,
            "ItemHeaderID":1018,
            "GenericName":"Keyboard",
            "ItemCatID":0,
            "Quantity":1,
            "IsActive":0,
            "IsComponent":0,
            "isAsset":1,
            "SubCatalogs":null
         },
         {  
            "DetailID":40089,
            "PRNo":33420,
            "Total":0,
            "Justification":null,
            "SAPAssetCode":null,
            "InventoryDetails":null,
            "DeliveryDate":null,
            "DeploymentDate":null,
            "CurrentApproverID":null,
            "CurrentApproval":false,
            "Specification":null,
            "StockID":null,
            "QuotedPrice":null,
            "QuotedTotalPrice":null,
            "PONo":null,
            "Remarks":"For PO",
            "DeptStockID":null,
            "Confirmation":null,
            "Flag":0,
            "ApprovalFlag":0,
            "SerialNo":null,
            "SubItems":null,
            "ParentID":null,
            "ItemID":1054,
            "ItemDescription":"Mouse Optical, USB ",
            "Price":0,
            "ItemCatSubID":1063,
            "SubCategoryName":"Peripherals & Accessories",
            "Brand":"Lenovo",
            "Model":"LXB MO28UOA ",
            "Unit":null,
            "UnitID":0,
            "ItemHeaderID":1016,
            "GenericName":"Mouse",
            "ItemCatID":0,
            "Quantity":1,
            "IsActive":0,
            "IsComponent":0,
            "isAsset":1,
            "SubCatalogs":null
         }
      ],
      "ParentID":null,
      "ItemID":1016,
      "ItemDescription":"Lenovo Desktop; Office Worker 1 as General User Core i3, HDD 500GB SATA,  RAM 4GB, LCD Display 20”, Windows 7 Professional, 64-bit, CPU Warranty 5/5/5, Monitor Warranty 3/3/3",
      "Price":31400,
      "ItemCatSubID":1061,
      "SubCategoryName":"Computers",
      "Brand":"Lenovo",
      "Model":"Thinkcentre M72e",
      "Unit":null,
      "UnitID":0,
      "ItemHeaderID":1001,
      "GenericName":"Desktop for Office Worker 1 (General User)",
      "ItemCatID":0,
      "Quantity":1,
      "IsActive":0,
      "IsComponent":1,
      "isAsset":1,
      "SubCatalogs":null
   }
];

var additionalData={"ItemID":1016,"ItemDescription":"Core i3, HDD 500GB SATA,  RAM 4GB, LCD Display 20”, Windows 7 Professional, 64-bit, CPU Warranty 5/5/5, Monitor Warranty 3/3/3","Price":31400,"ItemCatSubID":1061,"SubCategoryName":"Computers","Brand":"Lenovo","Model":"Thinkcentre M72e","Unit":"Unit","UnitID":478,"ItemHeaderID":1001,"GenericName":"Desktop for Office Worker 1 (General User)","ItemCatID":1001,"Quantity":1,"IsActive":1,"IsComponent":1,"isAsset":1,"SubCatalogs":[{"ItemID":1051,"ItemDescription":"Core i3, HDD 500GB SATA,  RAM 4GB, Windows 7 Professional, 64-bit","Price":27500,"ItemCatSubID":1063,"SubCategoryName":"Peripherals & Accessories","Brand":"Lenovo","Model":"Thinkcentre M72e","Unit":"Unit","UnitID":478,"ItemHeaderID":1023,"GenericName":"CPU","ItemCatID":1001,"Quantity":1,"IsActive":1,"IsComponent":0,"isAsset":1,"SubCatalogs":null},{"ItemID":1052,"ItemDescription":"LCD Display 19” ","Price":0,"ItemCatSubID":1063,"SubCategoryName":"Peripherals & Accessories","Brand":"Lenovo","Model":"ThinkVision L197Wa","Unit":"Unit","UnitID":478,"ItemHeaderID":1019,"GenericName":"Monitor","ItemCatID":1001,"Quantity":1,"IsActive":1,"IsComponent":0,"isAsset":1,"SubCatalogs":null},{"ItemID":1053,"ItemDescription":"Qwerty, USB","Price":0,"ItemCatSubID":1063,"SubCategoryName":"Peripherals & Accessories","Brand":"Lenovo","Model":"SK-8820","Unit":"Unit","UnitID":478,"ItemHeaderID":1018,"GenericName":"Keyboard","ItemCatID":1001,"Quantity":1,"IsActive":1,"IsComponent":0,"isAsset":1,"SubCatalogs":null},{"ItemID":1054,"ItemDescription":"Optical, USB ","Price":600,"ItemCatSubID":1063,"SubCategoryName":"Peripherals & Accessories","Brand":"Lenovo","Model":"LXB MO28UOA ","Unit":"Unit","UnitID":478,"ItemHeaderID":1016,"GenericName":"Mouse","ItemCatID":1001,"Quantity":1,"IsActive":1,"IsComponent":0,"isAsset":1,"SubCatalogs":null}],"Flag":1000,"ApprovalFlag":1,"Total":31400,"SubItems":null};


requestedItemsCache.push(additionalData);
requestedItemsCache.push(additionalData);
requestedItemsCache.push(additionalData);

var x=document.getElementById("output");

/*RENDER ORIGINAL SCHEMA*/
x.innerHTML = "Original Value : " + x.innerHTML + requestedItemsCache[0].Flag + "<br/>";

requestedItemsCache[0].Flag=2000;
x.innerHTML = x.innerHTML+ "Update Value : "  + requestedItemsCache[0].Flag + "<br/><br/> THIS IS OK! </br/><br/>";



/*ORIGINAL VALUE*/
x.innerHTML =x.innerHTML+"Original Value Index 1 : " +(requestedItemsCache[1].Flag) + "<br/>";
x.innerHTML =x.innerHTML+"Original Value Index 2 : " +(requestedItemsCache[2].Flag) + "<br/>";
x.innerHTML =x.innerHTML+"Original Value Index 3: " +(requestedItemsCache[3].Flag) + "<br/><br/><br/";

/*BUG IN UPDATING JSON OBJECT*/
x.innerHTML = x.innerHTML+ " Update element at index 1" + "<br/><br/><br/>";

requestedItemsCache[3].Flag=3000;

x.innerHTML =x.innerHTML+"Updated Value Index 1 : " +(requestedItemsCache[1].Flag) + "<br/>";
x.innerHTML =x.innerHTML+"Updated Value Index 2 : " +(requestedItemsCache[2].Flag) + "<br/>";
x.innerHTML =x.innerHTML+"Updated Value Index 3: " +(requestedItemsCache[3].Flag) + "<br/>";

console.log(requestedItemsCache[1].Flag);
console.log(requestedItemsCache[2].Flag);
console.log(requestedItemsCache[3].Flag);
var additionalData={...};

requestedItemsCache.push(additionalData);
requestedItemsCache.push(additionalData);
requestedItemsCache.push(additionalData);
requestedItemsCache.push({...});
requestedItemsCache.push({...});
requestedItemsCache.push({...});