<code>const getUserAll = new Promise ( function (todoBien, todoMal) { setTimeout(function () { todoBien() }, 5000) }) const getU...

Pregunta de la clase:
Promesas
Víctor Hugo Arango Madrid

Víctor Hugo Arango Madrid

Pregunta
studenthace 6 años
const getUserAll = new Promise ( function (todoBien, todoMal) { setTimeout(function () { todoBien() }, 5000) }) const getUser = new Promise ( function (todoBien, todoMal) { setTimeout(function () { todoBien() }, 3000) }) Promise.all([ getUser, getUserAll ]) .then(function () { console.log('Se acabó el tiempo'); }) .catch(function () { console.log('hubo un error en la promesa'); })
1 respuestas
para escribir tu comentario
    Emmanuel García

    Emmanuel García

    studenthace 5 años

    Le falta un espacio new Promise, por eso no te funciona. PD. probado con tu código

    new Promise
Curso de jQuery a JavaScript 2018

Curso de jQuery a JavaScript 2018

Aprende a pasar código de jQuery a JS. Crea páginas dinámicas y animaciones en muy poco tiempo. Optimiza tu código jQuery y programa scripts de forma fácil y rápida con Javascript.

Curso de jQuery a JavaScript 2018
Curso de jQuery a JavaScript 2018

Curso de jQuery a JavaScript 2018

Aprende a pasar código de jQuery a JS. Crea páginas dinámicas y animaciones en muy poco tiempo. Optimiza tu código jQuery y programa scripts de forma fácil y rápida con Javascript.