Created
February 12, 2015 20:15
-
-
Save killtheliterate/213b35ebc20b62ecfcdb 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 counter = function(wordToCount) { | |
return function(findIn) { // an closure, a closure. | |
return findIn.match(new RegExp(wordToCount, 'g')).length; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment