I don't understand why code continues to run even after return and res.send() was called. This is a GIST to help to understand.
UPDATE:
Well, after help of community now discovery and understand that the problem is that return res.send();
occur async, in parallel of console.log()
.
In this specific case, the solution is wrap inside if/else
.
Thanks to @Tom and @PaulPro!