Created
June 25, 2015 21:20
-
-
Save wmantly/f2c5b0c3523766ccca17 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
| 1. Pure Javascript | |
| Create a StringParser class that takes a string as constructor argument. | |
| A StringParser instance must provide the following : | |
| ● Get the number of occurrences of a given character | |
| ● Get the characters with the most/least occurrences | |
| ● Be able to work in case insensitive mode (if needed). | |
| Bonus points if: | |
| ● The methods can also be called directly without building a StringParser object (eg by | |
| calling StringParser.prototype.xxx...) | |
| ● The methods can somehow also work on other arraylike objects (eg arrays, | |
| arguments object, DOM collections, etc) | |
| ● A StringParser instance can be constructed using a promise (that will eventually be | |
| resolved to a string), feel free to adapt the interface for other methods (arguments, return values, callbacks...) for this case | |
| You should also provide documentation for your class (any format doesn't matter) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment