Created
January 19, 2015 09:56
-
-
Save lotz84/93c4d7caef9841cc25d3 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
var contEach = function(arr,f) { | |
if (arr.length == 0) {return;} | |
var next = function(){contEach(arr.splice(1),f);} | |
f(arr[0], next); | |
} | |
// Example | |
contEach(queries, function(query, next){ | |
$.get("https://www.google.co.jp/search?q="+query,function(body){ | |
// some process with body | |
next(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment