From 2b7eacc822cd921364916e2fd973fa46a173a284 Mon Sep 17 00:00:00 2001 From: Rafa Date: Thu, 9 Oct 2025 22:58:37 +0200 Subject: [PATCH 1/6] feat: iteration 1 --- .vscode/settings.json | 3 +++ index.js | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..6f3a291 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "liveServer.settings.port": 5501 +} \ No newline at end of file diff --git a/index.js b/index.js index aa0a0fd..492ac72 100644 --- a/index.js +++ b/index.js @@ -4,8 +4,7 @@ // Write code that prints out to the console the index of the character ā€œjā€ in const string1 = "My favorite dessert is jello"; - -// Your code here... +console.log(string1.indexOf('j')); From 1bfa3af5106aaadac51505628314272e8db31329 Mon Sep 17 00:00:00 2001 From: Rafa Date: Thu, 9 Oct 2025 23:09:50 +0200 Subject: [PATCH 2/6] feat: iteration 2 --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 492ac72..f6901ec 100644 --- a/index.js +++ b/index.js @@ -15,8 +15,8 @@ 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"; - -// Your code here... +const stringNew = string2[string2.indexOf('C')] + string2[string2.indexOf('O')] + string2[string2.indexOf('O')] + string2[string2.indexOf('L')]; +console.log(stringNew); From 1b531d0f3d70e3be6e98bdf012a44052e45adc27 Mon Sep 17 00:00:00 2001 From: Rafa Date: Thu, 9 Oct 2025 23:13:35 +0200 Subject: [PATCH 3/6] feat: iteration 3 --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index f6901ec..49433ce 100644 --- a/index.js +++ b/index.js @@ -27,8 +27,9 @@ console.log(stringNew); // Using the method .repeat() and the provided string, print out the text "NaNaNaNa Batman!" in the console. const string3 = "Na"; +const character = string3.repeat(3) + ' Batman!'; +console.log(character); -// Your code here... From 3edc881aef7f7f01260d66c1b2a6b8d7f4ab1f8d Mon Sep 17 00:00:00 2001 From: Rafa Date: Thu, 9 Oct 2025 23:53:09 +0200 Subject: [PATCH 4/6] feat: iteration 4 --- index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 49433ce..2c25dea 100644 --- a/index.js +++ b/index.js @@ -40,8 +40,9 @@ console.log(character); // 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"; - -// Your code here... +const fruitSelect = 'kiwi'; +const i = fruit.indexOf(fruitSelect); +console.log(fruit.slice(i, i + fruitSelect.length)); From da3e6451cf8a827857dcc146eb44917d1fe1f5e8 Mon Sep 17 00:00:00 2001 From: Rafa Date: Fri, 10 Oct 2025 00:08:24 +0200 Subject: [PATCH 5/6] feat: iteration 5 --- index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index 2c25dea..f6f047e 100644 --- a/index.js +++ b/index.js @@ -55,14 +55,14 @@ console.log(fruit.slice(i, i + fruitSelect.length)); const funnyHeadline1 = "Breathing oxygen linked to staying alive"; const funnyHeadline2 = "Students Cook & Serve Grandparents"; - - +const word = "oxygen"; +const message1 = "The string includes the word 'oxygen'"; +const message2 = "The string does not include the word 'oxygen'"; // Check the first headline -// Your code here ... - +console.log(funnyHeadline1.includes(word) ? message1 : message2); // Check the second headline -// Your code here ... +console.log(funnyHeadline2.includes(word) ? message1 : message2); From 3c28c6d8d5596767a3a670f87cf152b74cb64c60 Mon Sep 17 00:00:00 2001 From: Rafa Date: Fri, 10 Oct 2025 00:11:55 +0200 Subject: [PATCH 6/6] feat: iteration 6 --- index.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index f6f047e..2727d6d 100644 --- a/index.js +++ b/index.js @@ -73,10 +73,9 @@ console.log(funnyHeadline2.includes(word) ? message1 : message2); 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.slice(-1));