What I have
const pets = ['cat', 'dog', 'bat'];
console.log(pets.filter((pet) => !pet.includes('cat', 'dog')));
Expected output
["bat"]
Actual Output
["dog", "bat"]
This is just an example. In my real code, I'm doing a delete action to my global state (useContext, useReducer).
convocatorias: state.convocatorias.filter(
(convocatoria) => !convocatoria._id.includes(action.payload)
),
action.payload
is an array of ids.