I am getting a weird unexpected output that I can't explain.
knowing that I am using Node.js and MongoDb, take a look at this code below (i):

is supposed to be faster then this code below (ii):

but weird enough I get this output in the console:

even though I am running block (i) before running block (ii), and if I switch those 2 blocks so that block (ii) gets executed before (i), this is what I get:
and sometimes I get 'seedRoles in NAN' in this case.
Can anyone explain this behavior in Node.js ?