Last active
November 25, 2022 21:35
-
-
Save raiandexter0607/7f3980ebf6adc448fbb570877819a05f to your computer and use it in GitHub Desktop.
asyncronism with callbacks
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 sum = function (num1, num2) { | |
console.log(num1 + num2); | |
} | |
const sumNumbers = function (callback) { | |
console.log('Summing numbers...'); | |
setTimeout(() => { | |
callback(5, 10); | |
}, 1000) | |
} | |
sumNumbers(sum); | |
console.log('holi') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment