Skip to content

Commit f14e1dd

Browse files
committed
revisited code, stuck on question 2
1 parent 3dd499b commit f14e1dd

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

stringing-characters-together/exercises/part-three.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,22 @@ let language = 'JavaScript';
66
let str1 = language.slice(0, 1);
77
let str2 = language.slice(4, 5);
88

9-
console.log(str1.concat('', str2));
9+
console.log(str1 + str2);
1010

1111
//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+
1419

15-
console.log(firstInitial + fourthInitial);
1620

1721
//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+
1825
console.log(`The abbreviaton for 'JavaScript' is '${firstInitial + fourthInitial}'.`)
1926

2027
//4. Just for fun, try chaining 3 or more methods together, and then print the result.

0 commit comments

Comments
 (0)