-
-
Save malintha/ca04820b8010762886942dc5500ef748 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
find(function() { | |
alert("Found the element"); | |
}); | |
alert("Meanwhile I show up"); | |
function find(callback) { | |
//The time consuming operation | |
setTimeout(function() { | |
//calling the passed callback function after 2 seconds | |
callback(); | |
} ,2000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment