Paracetamol.js馃拪| #202: Explica este c贸digo JavaScript

Cristian Fernando - Mar 13 '23 - - Dev Community

Explica este c贸digo JavaScript

Dificultad: Intermedio

const one = () => Promise.resolve("one");

const fn = async () => {
  console.log("Hola")
  const res = await one();
  console.log("Mundo")
  console.log(res)
}

console.log("Antes de la funci贸n")
fn()
console.log("Despues de la funci贸n")
Enter fullscreen mode Exit fullscreen mode

A. Antes de la funci贸n, Hola, Despu茅s de la funci贸n, one, Mundo
B. Antes de la funci贸n, Hola, Despu茅s de la funci贸n, Mundo, one
C. one, Hola, Mundo, Antes de la funci贸n, Despu茅s de la funci贸n
D. Ninguno de los anteriores

Respuesta en el primer comentario.


. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .