From 19399fbba6e5d7ce9b3971d921088c568ea06ce4 Mon Sep 17 00:00:00 2001 From: geripairo Date: Tue, 9 Aug 2022 21:49:22 +0200 Subject: [PATCH 1/3] done --- js/index.js | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/js/index.js b/js/index.js index 59e4af7fb..6f14c39d6 100644 --- a/js/index.js +++ b/js/index.js @@ -1,6 +1,18 @@ -// Iteration 1: Names and Input -// -// Iteration 2: Conditionals +console.log("I'm ready!"); +// const hacker1 = "Gerard"; + +// console.log(`The driver's name is ${hacker1}`) + +// const hacker2 = "Marcos"; + +// console.log(`The navigator's name is ${hacker2}`); + +// if( hacker1.length > hacker2.length ){ +// console.log(`The diver has the longest name, it has ${hacker1.length} characters`) +// } else if (hacker2.length > hacker1.length){ +// console.log(`It seems that the navigator has the longest name, it has ${hacker2.length} characters`); +// } else if (hacker1.length === hacker2.length){ +// console.log(`Wow, you both have equally long names, ${hacker1.length} characters`) +// } -// Iteration 3: Loops From 31074605d3aedb2fe24ada311947e3d25f605e4f Mon Sep 17 00:00:00 2001 From: geripairo Date: Tue, 9 Aug 2022 21:54:36 +0200 Subject: [PATCH 2/3] iteration 1 and iteration 2 finished --- js/index.js | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/js/index.js b/js/index.js index 6f14c39d6..bf760bc54 100644 --- a/js/index.js +++ b/js/index.js @@ -1,18 +1,24 @@ +// IM READY TO START! + console.log("I'm ready!"); -// const hacker1 = "Gerard"; +// ITERARION 1 + +const hacker1 = "Gerard"; + +console.log(`The driver's name is ${hacker1}`) -// console.log(`The driver's name is ${hacker1}`) +const hacker2 = "Marcos"; -// const hacker2 = "Marcos"; +console.log(`The navigator's name is ${hacker2}`); -// console.log(`The navigator's name is ${hacker2}`); +// ITERATION 2 -// if( hacker1.length > hacker2.length ){ -// console.log(`The diver has the longest name, it has ${hacker1.length} characters`) -// } else if (hacker2.length > hacker1.length){ -// console.log(`It seems that the navigator has the longest name, it has ${hacker2.length} characters`); -// } else if (hacker1.length === hacker2.length){ -// console.log(`Wow, you both have equally long names, ${hacker1.length} characters`) -// } +if( hacker1.length > hacker2.length ){ + console.log(`The diver has the longest name, it has ${hacker1.length} characters`) +} else if (hacker2.length > hacker1.length){ + console.log(`It seems that the navigator has the longest name, it has ${hacker2.length} characters`); +} else if (hacker1.length === hacker2.length){ + console.log(`Wow, you both have equally long names, ${hacker1.length} characters`) +} From 30e050dd7e0f3773138c0a59271d42c26450af8b Mon Sep 17 00:00:00 2001 From: geripairo Date: Thu, 11 Aug 2022 22:24:02 +0200 Subject: [PATCH 3/3] finished lab iteration 3 --- js/index.js | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/js/index.js b/js/index.js index bf760bc54..783c12f51 100644 --- a/js/index.js +++ b/js/index.js @@ -22,3 +22,41 @@ if( hacker1.length > hacker2.length ){ console.log(`Wow, you both have equally long names, ${hacker1.length} characters`) } +// ITERATION 3 + +const driver = "Thor"; +const navigator = "Thanos"; + +// const splittedDriver = driver.split(''); +// console.log(splittedDriver.join(' ').toUpperCase()); + +// const splittedNavigator = navigator.split(''); +// console.log(splittedNavigator.reverse().join('')); + +// 3.1 + +let printDriver = ""; +for(let i= 0; i=0; j--){ + printNavigator += driver[j]; +} +console.log(printNavigator); + + +// 3.3 + +if (driver > navigator){ + console.log("Yo, the navigator goes first definitely"); +} else if (driver < navigator){ + console.log("The driver's name goes first."); +} else if(driver === navigator){ + console.log("What?! You both have the same name?") +} +