-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexercise-4.js
More file actions
32 lines (26 loc) · 822 Bytes
/
exercise-4.js
File metadata and controls
32 lines (26 loc) · 822 Bytes
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
/*
Conditionals
---------------------------------
Write a function that checks if a sentence contains the word "code"
- if the sentence contains the word "code" then return true
- otherwise return false
Hint: Google how to check if a string contains a word
*/
function containsCode(sentence) {
}
/*
DO NOT EDIT BELOW THIS LINE
--------------------------- */
var sentence1 = "code your future";
var sentence2 = "draw your future";
var sentence3 = "design your future";
console.log("'" + sentence1 + "': " + containsCode(sentence1))
console.log("'" + sentence2 + "': " + containsCode(sentence2))
console.log("'" + sentence3 + "': " + containsCode(sentence3))
/*
EXPECTED RESULT
---------------
'code your future': true
'draw your future': false
'design your future': false
*/