Javascript array value is undefined inside loop

I am trying to compare two objects. If an item inside checkedList is also found inside savedList i would like to copy the first item in the array from checkedList and place it with the found item in savedList. If items inside the checkedList is not found in the savedList I want to add the entire item to savedList. I dont wish to keep the same item twice inside the savedList. I am using the pop/push method to do this.

Problem I am running into is inside the [ while->for loop].
Uncaught TypeError: Cannot read properties of undefined (reading ‘1’)
When an item is found inside the savedList I wish to make the necessary alteration then move to the next item via pop(). However,
when I use the pop() method the previous item is lost. Below is my working code as well as a link to JSFiddle.

Desired Output:
savedItemList = {
“listName”: “List_daily:Daily Get From Back List”,
“date”: “”,
“itemList”: [
[ 11, 888 ], [ 55, 227 ], [ 44, 236 ],
[ 3, 700 ], [ 2, 600 ]
]
};

var savedItemList = {
    "listName": "List_daily:Daily Get From Back List",
    "date": "",
    //itemList contains [item quantity, item ID]
    "itemList": [
      [  1, 888 ], [  2, 227 ],  [  3, 236 ],
      [  3, 700 ],  [  2, 600 ]
    ]
};

var checkedItemList = [
    //itemData contains [item quantity, item ID]
    { "rowNumber": 1,  "itemData": [ 11, 888 ]  },
    { "rowNumber": 4,  "itemData": [ 44, 236 ]  },
    { "rowNumber": 3,  "itemData": [ 55,  227]  }
];

function moveItemsToList(savedItemList, checkedItemList)
{
  //while checkedItemList length is not zero
     while(checkedItemList.length)
     {
     //pop the last element inside checkedList
         var temp = checkedItemList.pop().itemData;
     //loop through the items inside savedList
     for(let k=0; k < savedItemList.itemList.length; k++)
        {
      //compare temp[1] itemID with savedList itemID
            if(temp[1] == savedItemList.itemList[k][1])
            {
        //if found save the quantity from temp[0] variable to savedItemList 
                savedItemList.itemList[k][0] = temp[0];
        //then move onto the next item on checkedList
                temp = checkedItemList.pop();
            }
        }
     //if items from CheckedList not Found in savedList        //Add the item and its quantity to savedList
        savedItemList.itemList.push(temp);
            
     }
     console.log(savedItemList);    
     
}

moveItemsToList(savedItemList, checkedItemList);