Skip to content
Open
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
20 changes: 19 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
const string1 = "My favorite dessert is jello";

// Your code here...
string1.indexOf("j");
console.log(string1.indexOf("j"))



Expand All @@ -22,15 +24,18 @@ const string2 = "ABCDEFGHJKLO";




/*****************************************************
Iteration 3 | Repeat a String and Concatenate
*****************************************************/
// Using the method .repeat() and the provided string, print out the text "NaNaNaNa Batman!" in the console.

const string3 = "Na";


// Your code here...

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



Expand All @@ -41,8 +46,12 @@ const string3 = "Na";

const fruit = "banana apple mango orange lemon kiwi watermelon grapes pear pineapple";


// Your code here...

console.log(fruit.length)
console.log(fruit.slice(60))



/***************************************************
Expand All @@ -56,14 +65,19 @@ const funnyHeadline1 = "Breathing oxygen linked to staying alive";
const funnyHeadline2 = "Students Cook & Serve Grandparents";


console.log(funnyHeadline1, funnyHeadline2.includes("oxygen"));



// Check the first headline
// Your code here ...
console.log(funnyHeadline1.includes("oxygen"));


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


console.log(funnyHeadline2.includes("oxygen"));

/*******************************************
Iteration 6 | String Length
Expand All @@ -76,6 +90,10 @@ 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 ...

const lastChar = string4[16]
console.log(lastChar)