fix(mostUsedChar): Correção nono exercício

This commit is contained in:
Vinícius Gabriel 2022-10-28 08:33:54 -03:00
parent bcb4477fc5
commit fff7022e81

View File

@ -1,5 +1,5 @@
export function mostUsedChar(text) { export function mostUsedChar(text) {
let cont = 0, i, j, contador = 0, valorFinal; let cont = 0, contador = 0, finalVlue;
let texto = text.split(""); let texto = text.split("");
for (let i = 0; i < texto.length; i++) { for (let i = 0; i < texto.length; i++) {
@ -11,8 +11,8 @@ export function mostUsedChar(text) {
} }
if (cont >= contador) { if (cont >= contador) {
contador = cont; contador = cont;
valorFinal = texto[i] finalVlue = texto[i]
} }
} }
return valorFinal; return finalVlue;
} }