I have array with object in localstorage image
Some a function return object with new data. I need to write new data to object in localstorage (identify by ID).
I tried but... See my code below
const result = {
type: 'mobile',
id: 'tsy152ivm',
score: 55
}
const links = JSON.parse(localStorage.getItem('links'));
const item = links.find(item => item.id === result.id);
//localStorage.setItem('links', JSON.stringify(item));