We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ffcc725 commit 0b67ee6Copy full SHA for 0b67ee6
chapter_three.js
@@ -17,12 +17,10 @@ function isEven(n) {
17
if (n === -1) return false;
18
else return isEven(n + 2);
19
}
20
- if (n === 0) {
21
- return true;
22
- }
+ if (n === 0) return true;
23
24
25
-console.log(isEven(-50));
+console.log(isEven(-7));
26
27
//count beans - write a function that takes a string argument and returns the number of uppercase Bs in it
28
@@ -36,6 +34,8 @@ function countBs(word) {
36
34
37
35
console.log(countBs('BBC'));
38
+//count characters - write a function that takes two string arguments: a word and a letter and counts the given letter's occurences in the given word
+
39
function countChar(word, char) {
40
let count = 0;
41
for (let i = 0; i < word.length; i++) {
0 commit comments