Sobes.tech
Junior — Senior

Determine what will be output to the console and why (task 11)

livecode

Task condition

Determine the order of output to the console and explain why the data appears in that particular order.

const ZERO_MS = 0;

function printConsole(arg) {
  console.log(arg);
}

function task1() {
  printConsole('🍏');

  setTimeout(printConsole, ZERO_MS, '🍋');

  new Promise(resolve => {
    resolve('🍉');
  }).then(printConsole);

  printConsole('🍇');
}

task1();