export function mostUsedChar(text) { let cont = 0, contador = 0, finalVlue; let texto = text.split(""); for (let i = 0; i < texto.length; i++) { cont = 0; for (let j = 0; j < texto.length; j++) { if (texto[i].toUpperCase() === texto[j].toUpperCase()) { cont++ } } if (cont >= contador) { contador = cont; finalVlue = texto[i] } } return finalVlue; }