Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"liveServer.settings.port": 5501
}
29 changes: 21 additions & 8 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@

const string1 = "My favorite dessert is jello";

// Your code here...


// Your code

console.log(string1.indexOf(`j`))

/*******************************************
Iteration 2 | Concatenate Characters
Expand All @@ -19,6 +18,9 @@ const string2 = "ABCDEFGHJKLO";

// Your code here...

word = string2[2] + string2[11] + string2[11] + string2[10]

console.log(word)



Expand All @@ -31,7 +33,7 @@ const string3 = "Na";

// Your code here...


console.log(`${string3.repeat(4)} Batman!`)


/*******************************************
Expand All @@ -43,7 +45,7 @@ const fruit = "banana apple mango orange lemon kiwi watermelon grapes pear pinea

// Your code here...


console.log(fruit.slice(0,6))

/***************************************************
Iteration 5 | Check If Strings Include a Word
Expand All @@ -58,12 +60,22 @@ const funnyHeadline2 = "Students Cook & Serve Grandparents";

// Check the first headline
// Your code here ...

if (funnyHeadline1.includes('oxygen')) {
console.log(`The string includes the word 'oxygen'`);
}
else {
console.log(`The string does not include the word 'oxygen'`)
}

// Check the second headline
// Your code here ...


if (funnyHeadline2.includes('oxygen')) {
console.log(`The string includes the word 'oxygen'`);
}
else {
console.log(`The string does not include the word 'oxygen'`)
}

/*******************************************
Iteration 6 | String Length
Expand All @@ -75,7 +87,8 @@ const string4 = "zEAWrTC9EgtxmK9w1";

// a) Print the string length
// Your code here ...

console.log(string4.length)

// b) Print the last character in the string
// Your code here ...
console.log(string4[string4.length-1])