Skip to content

Commit fd9f9c7

Browse files
authored
Merge pull request #5 from infinotiver/deepsource-autofix-019ece25
refactor: fix out of bounds array access in for-loop
2 parents 10d8f0f + af61444 commit fd9f9c7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Tutorials/Basic/challenge.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function countVowelsAndConsonants(str) {
1818
let digit_count = 0;
1919
let digit_sum = 0
2020

21-
for(var i = 0; i <= str.length; i++) {
21+
for(var i = 0; i < str.length; i++) {
2222
if(vowels.includes(str[i])) {
2323
vowel_count++
2424
}

0 commit comments

Comments
 (0)