app.get(‘/api/persons/:id’, (req, res)=> {
const id = Number(req.params.id);
const getPerson = persons.find(person =>
{
person.id === id? person
: “no person found”
});
console.log(getPerson)
})
why m i getting undefined? what m i doing wrong?