Skip to content

Instantly share code, notes, and snippets.

@malintha

malintha/file.js Secret

Last active June 7, 2016 05:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save malintha/ca04820b8010762886942dc5500ef748 to your computer and use it in GitHub Desktop.
Save malintha/ca04820b8010762886942dc5500ef748 to your computer and use it in GitHub Desktop.
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