From 999f6cae3111035538d885f28ce06193e31b679b Mon Sep 17 00:00:00 2001 From: Marga Date: Tue, 9 Aug 2022 22:37:19 +0200 Subject: [PATCH 1/2] done --- js/index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/js/index.js b/js/index.js index 59e4af7fb..51406e1e0 100644 --- a/js/index.js +++ b/js/index.js @@ -1,5 +1,11 @@ // Iteration 1: Names and Input // +const hacker1 = "Kurt"; +console.log("the driver's name is " + hacker1) +const hacker2 = "Monika"; +console.log("the navigator's name is " + hacker2) + + // Iteration 2: Conditionals From 2d084066d7b2562b9402fbbc90d13e46d83a9127 Mon Sep 17 00:00:00 2001 From: Marga Date: Sat, 13 Aug 2022 01:02:09 +0200 Subject: [PATCH 2/2] done --- js/index.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/js/index.js b/js/index.js index 51406e1e0..3d0af25ab 100644 --- a/js/index.js +++ b/js/index.js @@ -8,5 +8,25 @@ console.log("the navigator's name is " + hacker2) // Iteration 2: Conditionals +function longestName(name1, name2) { + if (name1.length > name2.length) { + console.log("the driver has the longest name, it has " + name1.length + " characters") + } else if (name1.length < name2.length) { + console.log("It seems that the navigator has the longest name, it has " + name2.length + " characters") + } + else + console.log("Wow, you both have equally long names, " + name1.length + " characters") + + +} +longestName(hacker1, hacker2) + // Iteration 3: Loops +const separateNamesLetters = hacker1.split("").join(" ").toUpperCase(); +console.log(separateNamesLetters) +const printReverse = hacker2.split("").reverse().join(""); +console.log(printReverse) +function alphabeticOrder(name1, name2) { + if +} \ No newline at end of file