File tree 1 file changed +11
-4
lines changed
stringing-characters-together/exercises
1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -6,15 +6,22 @@ let language = 'JavaScript';
6
6
let str1 = language . slice ( 0 , 1 ) ;
7
7
let str2 = language . slice ( 4 , 5 ) ;
8
8
9
- console . log ( str1 . concat ( '' , str2 ) ) ;
9
+ console . log ( str1 + str2 ) ;
10
10
11
11
//2. Without using slice(), use method chaining to accomplish the same thing.
12
- let firstInitial = language [ 0 ] ;
13
- let fourthInitial = language [ 4 ] ;
12
+ console . log ( language ) ;
13
+ // let letterLocation1 = language.indexOf("J");
14
+ // let letterLocation2 = language.indexOf("S");
15
+
16
+ // console.log(letterLocation1);
17
+ // console.log(letterLocation2);
18
+
14
19
15
- console . log ( firstInitial + fourthInitial ) ;
16
20
17
21
//3. Use bracket notation and a template literal to print, "The abbreviation for 'JavaScript' is 'JS'."
22
+ let firstInitial = language [ 0 ] ;
23
+ let fourthInitial = language [ 4 ] ;
24
+
18
25
console . log ( `The abbreviaton for 'JavaScript' is '${ firstInitial + fourthInitial } '.` )
19
26
20
27
//4. Just for fun, try chaining 3 or more methods together, and then print the result.
You can’t perform that action at this time.
0 commit comments