Skip to content

Commit 06992e0

Browse files
committed
refactor: remove empty line
1 parent b898a00 commit 06992e0

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

String/PercentageOfLetters.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,9 @@ const percentageOfLetter = (str, letter) => {
1818
// Iterate through the whole given text
1919
for (let i = 0; i < str.length; i++) {
2020
// Count how often the letter appears in the word
21-
letterCount = str[i].toLowerCase() === letter.toLowerCase() ? letterCount + 1 : letterCount + 0
21+
letterCount += str[i].toLowerCase() === letter.toLowerCase() ? 1 : 0
2222
}
2323
const percentage = Math.floor((100 * letterCount) / str.length)
24-
2524
return percentage
2625
}
2726

0 commit comments

Comments
 (0)