Hey, good spot! I had mean to use the word "remove" rather than "delete" as it's a reserved word in JavaScript. Switch it out on this line and all should work nicely:

`const {[id]: remove, ...newList } = state.list`

Note: the word "remove" isn't special here, it can be any non-reserved word, even "removeThisItemFromTheObject" etc etc

Kitson Broadhurst
Kitson Broadhurst

Written by Kitson Broadhurst

Senior Web Engineer at Kin + Carta, London, working mainly with React @kit_son

Responses (1)