Paracetamol.js๐Ÿ’Š| #119: ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ ์ฝ”๋“œ ์„ค๋ช…

2771 ๋‹จ์–ด webdevjavascriptspanishdiscuss

ยฟCuรกl es el orden de ejecuciรณn de este cรณdigo JavaScript?



๋‚œ์ด๋„: Avanzado




const tom = () => console.log('Tom');

const jerry = () => console.log('Jerry');

const cartoon = () => {
  console.log('Cartoon');

  setTimeout(tom, 5000);

  new Promise((resolve, reject) =>
    resolve('should it be right after Tom, before Jerry?')
  ).then(resolve => console.log(resolve))

  jerry();
}

cartoon();


A. Cartoon , Jerry , should it be right after Tom, before Jerry? , TomB. Tom , Jerry , Cartoon , should it be right after Tom, before Jerry?C. Cartoon , Jerry , Tom , should it be right after Tom, before Jerry?D. Ninguna de las anteriores.

Respuesta en el primer comentario.

์ข‹์€ ์›นํŽ˜์ด์ง€ ์ฆ๊ฒจ์ฐพ๊ธฐ