This repository was archived by the owner on Apr 18, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 49
Expand file tree
/
Copy pathis-vowel.js
More file actions
71 lines (61 loc) · 1.34 KB
/
is-vowel.js
File metadata and controls
71 lines (61 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
function isVowel(letter) {
return (
letter === "a" ||
letter === "e" ||
letter === "i" ||
letter === "o" ||
letter === "u"
);
}
// here is an implementation of isVowel - this function checks if a letter is a vowel
let letter = "a";
console.log(
"It is " +
(isVowel(letter) ? "true" : "false") +
" that letter '" +
letter +
"' is a vowel."
);
// console.log("case: letter a...");
const currentOutput = isVowel("a");
const targetOutput = true;
console.assert(
currentOutput === targetOutput,
"current output: %s, target output: %s",
currentOutput,
targetOutput
);
letter = "e";
console.log(
"It is " +
(isVowel(letter) ? "true" : "false") +
" that letter '" +
letter +
"' is a vowel."
);
// console.log("case: letter e...");
const currentOutput2 = isVowel("e");
const targetOutput2 = true;
console.assert(
currentOutput2 === targetOutput2,
"current output: %s, target output: %s",
currentOutput2,
targetOutput2
);
letter = "k";
console.log(
"It is " +
(isVowel(letter) ? "true" : "false") +
" that letter '" +
letter +
"' is a vowel."
);
// console.log("case: letter k...");
const currentOutput3 = isVowel("k");
const targetOutput3 = false;
console.assert(
currentOutput3 === targetOutput3,
"current output: %s, target output: %s",
currentOutput3,
targetOutput3
);