Skip to content
This repository was archived by the owner on Jan 14, 2024. It is now read-only.

Commit c73295b

Browse files
committed
Remove exercises not related to the lesson
This exercises were related to strings, not arrays
1 parent 67b697b commit c73295b

File tree

1 file changed

+0
-29
lines changed

1 file changed

+0
-29
lines changed

mandatory/6-journey-planner.js

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,3 @@
1-
/*
2-
Before we go to the big story, we will introduce some more string methods.
3-
Some of the methods you're using on arrays are similar to ones you can use on strings.
4-
Methods like: IndexOf, Include, Search, Slice , Spilt and more.
5-
6-
You can always Google how a method of a string works!
7-
Here are links to some of those:
8-
- https://www.w3schools.com/js/js_string_methods.asp
9-
- https://javascript.info/string#quotes
10-
Now let's do this small exercise
11-
12-
Using string methods update the checkCodeIsThere() function
13-
- The function will have a string as a parameter
14-
- The function should check if the word "code" exists in the string
15-
- If it does exist, return the index of it, if not return "Not found"
16-
17-
Hint: search for string methods like Includes and IndexOf.
18-
*/
19-
20-
function checkCodeIsThere(stringText) {
21-
let magicWord = "code";
22-
//edit code below
23-
if (stringText) {
24-
return stringText;
25-
} else {
26-
return "Not found";
27-
}
28-
}
29-
301
/*
312
I am new to London and would like to know what transport I can take to different famous locations.
323
The input provided contains a list of locations in London. Each of locations is followed by a list

0 commit comments

Comments
 (0)