score:3

Accepted answer
const removeItem = (items, id) => {
    items[id] && delete items[id];
    return {...items};
};

score:1

const removeItem = (items, id) => {
    let itemsClone = [...items]; // Copies all items into a brand new array
    itemsClone [id] && delete itemsClone [id]; // You perform the delete on the clone
    return itemsClone ; // you return the clone
};

score:1

const removeItem = (items, id) => {
    let {[id]: remove, ...rest} = items
    return rest;
}

Related Query

More Query from same tag