Created
October 6, 2022 21:15
-
-
Save devmariodiaz/1cd85688049344d57878fef2563c8deb to your computer and use it in GitHub Desktop.
This file contains 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
const getUsuarioByID = (id, callback) => { | |
const usuario = { | |
id, | |
nombre: 'Mario' | |
} | |
setTimeout(() => { | |
callback(usuario); | |
}, 1500); | |
} | |
// Calling the function sending a callback method | |
getUsuarioByID(10, (usuario) => { | |
console.log(usuario.id); | |
console.log(usuario.nombre.toUpperCase()); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment