From d0dc2f267379b9bb82ce4d034d83b9dabe940fa8 Mon Sep 17 00:00:00 2001 From: hugo395 Date: Mon, 10 Feb 2020 21:34:16 +0000 Subject: [PATCH 1/2] done --- index.html | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 index.html diff --git a/index.html b/index.html new file mode 100644 index 000000000..e69de29bb From e136f48027835251a5a53f623ea6084155638377 Mon Sep 17 00:00:00 2001 From: hugo395 Date: Wed, 12 Feb 2020 19:24:06 +0000 Subject: [PATCH 2/2] done --- js/index.js | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/js/index.js b/js/index.js index dd8ff0062..e6ecdfbde 100644 --- a/js/index.js +++ b/js/index.js @@ -4,4 +4,28 @@ // Iteration 2: Conditionals -// Iteration 3: Loops \ No newline at end of file +// Iteration 3: Loops +console.log("I'm ready"); + +let hacker1 = 'Hugo'; +console.log(`The driver's name is ${hacker1}`); +let hacker2 = 'Someone'; +console.log(`The navigator's name is ${hacker2}`); + +//trying to find the largest .lenght + +let hacker1Length = hacker1.length +let hacker2Length = hacker2.length + +if(hacker1Length > hacker2Length){ + console.log("The driver has the longest name, it has " + hacker1.length + " characters.") +}else if(hacker2Length > hacker1Length){ + console.log("It seems that the navigator has the longest name, it has " + hacker2.length + " characters.") +}else{ + console.log("Wow, you both have equally long names, " +hacker1.length + " characters!.") +} + +/*Iteration 3: Loops +3.1 Print all the characters of the driver's name, separated by a space and in capitals i.e. "J O H N"*/ + +console.log(hacker1.toUpperCase().split("").join(" ")); \ No newline at end of file