From 35e289811f83f1c735ca7ce01cbb59d95638ae20 Mon Sep 17 00:00:00 2001 From: Didac Odena Date: Thu, 9 Oct 2025 21:21:14 +0200 Subject: [PATCH 1/5] feat: itineration 1 --- .vscode/settings.json | 3 +++ index.js | 5 ++--- 2 files changed, 5 insertions(+), 3 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..95a3f43 100644 --- a/index.js +++ b/index.js @@ -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 From 024810caefbac58ad75b1db07d8d85b5d87f46ec Mon Sep 17 00:00:00 2001 From: Didac Odena Date: Thu, 9 Oct 2025 21:38:43 +0200 Subject: [PATCH 2/5] feat: itinerations 2,3,4 --- index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 95a3f43..46c86a8 100644 --- a/index.js +++ b/index.js @@ -18,6 +18,9 @@ const string2 = "ABCDEFGHJKLO"; // Your code here... +word = string2[2] + string2[11] + string2[11] + string2[10] + +console.log(word) @@ -30,7 +33,7 @@ const string3 = "Na"; // Your code here... - +console.log(`${string3.repeat(4)} Batman!`) /******************************************* From 86c31540e52032e34597a244ac910750f1bab90a Mon Sep 17 00:00:00 2001 From: Didac Odena Date: Thu, 9 Oct 2025 21:42:34 +0200 Subject: [PATCH 3/5] feat: itineration 4 --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 46c86a8..522c5a2 100644 --- a/index.js +++ b/index.js @@ -45,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 From 028d8c0fdcd7fea40ecea7d50ee699a863e67374 Mon Sep 17 00:00:00 2001 From: Didac Odena Date: Fri, 10 Oct 2025 13:02:06 +0200 Subject: [PATCH 4/5] Feat: itineration 5 --- index.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 522c5a2..cba1841 100644 --- a/index.js +++ b/index.js @@ -60,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 From b30fa8a9f5b83438ae686b9797a94e9d34ea71c5 Mon Sep 17 00:00:00 2001 From: Didac Odena Date: Fri, 10 Oct 2025 13:07:47 +0200 Subject: [PATCH 5/5] Solved Lab --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index cba1841..8245bca 100644 --- a/index.js +++ b/index.js @@ -87,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]) \ No newline at end of file