Skip to content

Instantly share code, notes, and snippets.

Created Jun 7, 2016
What would you like to do?
find([1,2], response);
function response(err, result) {
if(err) {
else {
alert("operation successful : "+result);
alert("meanwhile I show up");
function find(elements, callback) {
//The time consuming operation
setTimeout(function() {
if(elements) {
callback(null, elements);
else {
callback("Elements array should not be null", null);
} ,2000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment