Explica este código JavaScript
Dificultad: Avanzado
const funcionAsincrona = () => {
return new Promise((resolve, reject) => {
if(true){
setTimeout(() => {
resolve("Todo bien brow");
},2500)
}else{
reject("Me cai...");
}
})
}
const funcionAsync = async() => {
try{
if(true){
const res = setTimeout(() => {
console.log("Todo bien looco");
},5000)
}
}catch(err){
console.log(err);
}
}
A. funcionAsync
solo esta escrita con sugar syntax.
B. Ambas son iguales en la practica.
C. Ambas son funciones asíncronas.
D. Todas las anteriores.
Respuesta en el primer comentario.