forked from M3-Academy/challenge-algorithms-v2.0
refactor(mostrepeatedchar):deixando o código mais apresentavel
This commit is contained in:
parent
3c55eae119
commit
6b964afa76
@ -8,5 +8,5 @@ export function mostUsedChar(text) {
|
|||||||
|
|
||||||
const maxVal = Math.max(...Object.values(counts));
|
const maxVal = Math.max(...Object.values(counts));
|
||||||
const num = Object.keys(counts).find((key) => counts[key] === maxVal);
|
const num = Object.keys(counts).find((key) => counts[key] === maxVal);
|
||||||
return num;
|
return num;
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user