Quick actions

cmd+k|ctrl+k

Navigation

Languages

Simple event-loop test

Snippet info

Language

JavaScript

Visibility

public

Author

dickeylth

Created

2018-12-11T12:23:22Z

Updated

2018-12-11T12:24:45Z

process.nextTick(() => {
  console.log('next tick');
});

new Promise(() => {
  console.log(123);
  return 123;
}).then(() => {
  console.log('done');
});

async function test() {
  console.log('async start');
  await test2();
  console.log('async end');
  return 'await';
}

async function test2() {
  console.log('async 2 start');
  return 'wait for me';
}

test();
INFO