score:0

Accepted answer
if (!newNotesList.length) return;
for (let i = 0; i < notes.length; i++) {
    //
}

if(notes[i].selected === true) {
    const findElementInNewNotesList = newNotesList.find(el => el.id === notes[i].id);
    if(findElementInNewNotesList.id) newNotesList[i].selected = true;
}

Related Query

More Query from same tag