Como substituir um valor no localStorage usando JavaScript

let productCost = +document.getElementById('projectcost').value;
let productQty = +document.getElementById('productQty'+id).value;
let product_list = JSON.parse(localStorage.getItem('myItems') ?? "[]");
                       .filter(({productId}) => productId != id)
                       .concat({productId: id, productCost, productQty});
localStorage.setItem('myItems', JSON.stringify(product_list));
SAMER SAEID