Created
March 27, 2021 16:47
-
-
Save coderdiaz/c67938bb2f94e7ced27c6f2f47ff75d6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Escribir una función llamada inOrder la cuál va ha aceptar dos callbacks y los invocaremos en orden. | |
const logOne = setTimeout(function() { | |
console.log("one!"); | |
}, Math.random() * 1000); | |
const logTwo = setTimeout(function() { | |
console.log("two!"); | |
}, Math.random() * 1000); | |
const inOrder = (logOne, logTwo) => { | |
// TODO | |
} | |
inOrder(logOne, logTwo); | |
// Output | |
// one! | |
// two! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment