Skip to content

Instantly share code, notes, and snippets.

@coderdiaz
Created March 27, 2021 16:47
Show Gist options
  • Save coderdiaz/c67938bb2f94e7ced27c6f2f47ff75d6 to your computer and use it in GitHub Desktop.
Save coderdiaz/c67938bb2f94e7ced27c6f2f47ff75d6 to your computer and use it in GitHub Desktop.
// 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