From d4d19687628d099809a3eb5f745814821b613a86 Mon Sep 17 00:00:00 2001 From: Sergio Otero Date: Thu, 9 Oct 2025 22:02:29 +0200 Subject: [PATCH 1/5] feat: iteration 1 completed --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index aa0a0fd..6bc8bd8 100644 --- a/index.js +++ b/index.js @@ -4,8 +4,8 @@ // Write code that prints out to the console the index of the character ā€œjā€ in const string1 = "My favorite dessert is jello"; +console.log(string1.indexOf("j")); -// Your code here... From e56b2fa6c6bfc1de949b96b2c2332f4c76cbac1c Mon Sep 17 00:00:00 2001 From: Sergio Otero Date: Thu, 9 Oct 2025 22:05:09 +0200 Subject: [PATCH 2/5] feat: iteration 2 completed --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 6bc8bd8..a4f5ded 100644 --- a/index.js +++ b/index.js @@ -16,8 +16,9 @@ console.log(string1.indexOf("j")); // Make a new string with the text "COOL" by using only the characters available in the provided string and the bracket notation const string2 = "ABCDEFGHJKLO"; +const finalString = string2[string2.indexOf("C")] + string2[string2.indexOf("O")] + string2[string2.indexOf("O")] + string2[string2.indexOf("L")]; +console.log(finalString); -// Your code here... From 3708aaede7098c20c955880c43d86be09f114811 Mon Sep 17 00:00:00 2001 From: Sergio Otero Date: Thu, 9 Oct 2025 22:19:15 +0200 Subject: [PATCH 3/5] feat: iteration 4 completed --- index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index a4f5ded..db32e79 100644 --- a/index.js +++ b/index.js @@ -29,8 +29,8 @@ console.log(finalString); // Using the method .repeat() and the provided string, print out the text "NaNaNaNa Batman!" in the console. const string3 = "Na"; +console.log(`${string3.repeat(3)} Batman!`); -// Your code here... @@ -41,8 +41,10 @@ const string3 = "Na"; // Using the string method .slice(), access and print to the console the name of your favorite fruit from a given string const fruit = "banana apple mango orange lemon kiwi watermelon grapes pear pineapple"; +const foodPosition = fruit.indexOf("lemon"); +console.log(fruit.slice(foodPosition, foodPosition + 5)); + -// Your code here... From 3f3e5e228064fbce722c73225fb5e119aa8a5621 Mon Sep 17 00:00:00 2001 From: Sergio Otero Date: Thu, 9 Oct 2025 22:36:01 +0200 Subject: [PATCH 4/5] feat: iteration 5 completed --- index.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/index.js b/index.js index db32e79..9681098 100644 --- a/index.js +++ b/index.js @@ -59,12 +59,18 @@ const funnyHeadline1 = "Breathing oxygen linked to staying alive"; const funnyHeadline2 = "Students Cook & Serve Grandparents"; -// Check the first headline -// Your code here ... - - -// Check the second headline -// Your code here ... +if (funnyHeadline1.includes("oxygen")) { + console.log("The string includes the word 'oxygen'"); +} else { + console.log("The string doesn't include the word 'oxygen'"); +} + + +if(funnyHeadline2.includes("oxygen")){ + console.log("The string includes the word 'oxygen'"); +} else { + console.log("The string doesn't include the word 'oxygen'"); +} From be753bacf89224eb633e2fd0d3158fd76090df60 Mon Sep 17 00:00:00 2001 From: Sergio Otero Date: Thu, 9 Oct 2025 22:38:17 +0200 Subject: [PATCH 5/5] feat: iteration 6 completed --- index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 9681098..f5773d7 100644 --- a/index.js +++ b/index.js @@ -82,8 +82,9 @@ if(funnyHeadline2.includes("oxygen")){ const string4 = "zEAWrTC9EgtxmK9w1"; -// a) Print the string length -// Your code here ... +console.log(string4.length); + +console.log(string4.charAt(string4.length-1)); // b) Print the last character in the string