Skip to content

Instantly share code, notes, and snippets.

@Malintha

Malintha/file.js Secret

Last active Jun 7, 2016
Embed
What would you like to do?
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
You can’t perform that action at this time.