Skip to content

Commit 80cb13c

Browse files
committed
remove conversion to array within char count function
1 parent f7c1dd7 commit 80cb13c

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

Sprint-3/2-practice-tdd/count.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
function countChar(str, char) {
2-
const arrayOfChars = Array.from(str);
32
let count = 0;
4-
for (letter of arrayOfChars) {
3+
for (letter of str) {
54
if (char === letter) {
65
count++;
76
}

0 commit comments

Comments
 (0)