Why do we use the question mark (?) what does this mean?
const q = req.query.q?.toLowerCase() || ‘’;
why do we use the dot (.) what does it mean? when I use it?
const results = animals.filter(animal => animal.type.toLowerCase().includes(q));
res.send(results);
});
I guess if you had to put it into words, “If everything in this accessor chain is undefined or null, then stop evaluating the chain here and evaluate the whole thing to undefined”.