A
A
Andriy0222022-02-19 19:50:57
Node.js
Andriy022, 2022-02-19 19:50:57

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 question

Ask a Question

731 491 924 answers to any question