Created
August 18, 2010 16:24
-
-
Save fb55/535315 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
//just wrote this code for a project. how cool is that? | |
var reqURL = (function loopRegExps (url, regExps) { | |
for(var i in regExps){ | |
if(url.match(regExps[i][0])){ return (regExps[i][1] + "url=" + encodeURIcomponent(url))} | |
} | |
})(url, collectionA); | |
/*just some thoughts: | |
I would always use a named function, so it can call itself if needed. It's just a good practice. | |
My project is far from being finished, but someday, it will be open sourced. | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment