Created
June 22, 2015 10:53
-
-
Save bogdanmoisin/4ec87da5a1c1c28d6f6c to your computer and use it in GitHub Desktop.
This file contains hidden or 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 countBs = function(str) { | |
| return str.match(/B/g).length; | |
| }; | |
| var countChar = function(str, character) { | |
| var matchExp = new RegExp(character, 'g'); | |
| return str.match(matchExp).length; | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment