Trying to access the value of the page on the query I wrote this code:
const page = parseInt(req.query.page) ?? 1
But when I tried to use page
it says that it's Nan. Changing the code in:
const page = parseInt(req.query.page) || 1
returns a normal integer instead. Why is this happening?