Created
October 30, 2020 01:10
-
-
Save jerlyrosa/91562de286f2c03c3292b5d68431043f to your computer and use it in GitHub Desktop.
Los Callbacks en javascript
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 elevadosCallbacks =(value, callback)=>{ | |
setTimeout(() => { | |
callback(value, value * 2) | |
}, 0 || Math.random() * 4000); | |
} | |
elevadosCallbacks(0, (value, resul)=>{ | |
console.info('Inicio Del Callbacks'); | |
console.log(`Resultado: ${value}, ${resul}`); | |
elevadosCallbacks(1, (value, resul)=>{ | |
console.log(`Resultado: ${value}, ${resul}`); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment