File tree Expand file tree Collapse file tree 1 file changed +20
-2
lines changed
Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,24 @@ function countChar(stringOfCharacters, findCharacter) {
77 }
88 return count ;
99}
10- console . log ( countChar ( "please work for me" , "e" ) )
10+ // console.log(countChar("please work for me", "e" )) //output is: 3
1111
12- module . exports = countChar ;
12+ // module.exports = countChar;
13+
14+ // function assertEquals(actualOutput, targetOutput) {
15+ // console.assert(
16+ // actualOutput === targetOutput,
17+ // `Expected ${actualOutput} to equal ${targetOutput}`
18+ // );
19+ // }
20+
21+ // assertEquals(countChar("aaaaa", "a" ), 5);
22+ // assertEquals(countChar("venue", "b" ), 0);
23+ // assertEquals(countChar("", "x" ), 0);
24+
25+ // try {
26+ // countChar(12);
27+
28+ // // This line will not be reached if an error is thrown as expected
29+ // console.error("Error was not thrown for invalid string");
30+ // } catch (error) {}
You can’t perform that action at this time.
0 commit comments