fix the mostRepeatedChar logic

This commit is contained in:
Marcela Mathias 2022-11-02 21:43:51 -03:00
parent 923c138af6
commit 8a86015c4f

View File

@ -3,7 +3,7 @@ export function mostUsedChar(text) {
letter = "";
text.split("").forEach(function (char) {
if (text.split(char).length > count) {
max = text.split(char).length;
count = text.split(char).length;
letter = char;
}
});