Answer the question
In order to leave comments, you need to log in
Why is the object not removed from the array by id?
app.post('/users/:id', (req, res) => {
const {id} = req.params;
users = users.filter(user => user.id !== id);
console.log(users)
res.redirect('/users');
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question