Skip to content

Instantly share code, notes, and snippets.

@jerlyrosa
Created October 30, 2020 01:10
Show Gist options
  • Save jerlyrosa/91562de286f2c03c3292b5d68431043f to your computer and use it in GitHub Desktop.
Save jerlyrosa/91562de286f2c03c3292b5d68431043f to your computer and use it in GitHub Desktop.
Los Callbacks en javascript
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