Realm Function execution flow

I’m using the Realm web UI to write a function. Depending on what follows a call to console.log, the log may not be printed. There are likely contextual factors as the case I’ve described isn’t deterministic. But it seems like something that pops up from time to time. I’m thinking that console.log is superseded by the findOne promise, relinquishes the thread which doesn’t return before exiting the function.

console.log('this will NOT print');
const item = await variousItems.findOne({_id: _id});
console.log('this will print');

I expect that putting this in a clean function may elicit different results. But in general terms with something like console.log, I would have expected execution to be sequential. I should mention, commenting out the middle line calling findOne results in both lines being printed to the console.