-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBanjo.js
More file actions
21 lines (15 loc) · 771 Bytes
/
Banjo.js
File metadata and controls
21 lines (15 loc) · 771 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* ----------------------------------------------------------------------------------------
Create a function which answers the question "Are you playing banjo?".
If your name starts with the letter "R" or lower case "r", you are playing banjo!
The function takes a name as its only argument, and returns one of the following
strings:
name + " plays banjo"
name + " does not play banjo"
Names given are always valid strings.
---------------------------------------------------------------------------------------- */
/*
String.prototype.toLowerCase(): returns this string converted to lower case
*/
function areYouPlayingBanjo(name) {
return `${name} ${name[0].toLowerCase() === "r" ? "plays banjo" : "does not play banjo" }`
}