From f9a934051d05d17ba1b1dec5058c3a659517f22c Mon Sep 17 00:00:00 2001 From: laura86bf Date: Wed, 10 Aug 2022 17:03:08 +0200 Subject: [PATCH 1/5] iteration1 --- js/index.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/js/index.js b/js/index.js index 59e4af7fb..3b92facfa 100644 --- a/js/index.js +++ b/js/index.js @@ -1,6 +1,15 @@ // Iteration 1: Names and Input // +console.log ("I'm ready!"); + +const hacker1 = "Manolo"; +console.log("The driver's name is " + hacker1 + "."); + +const hacker2 = "Google Chrome"; +console.log("The navigator's name is " + hacker2 + "."); + // Iteration 2: Conditionals // Iteration 3: Loops + From c17dcb3214ea563b9d86d48c9cfdd9b82a447711 Mon Sep 17 00:00:00 2001 From: laura86bf Date: Thu, 11 Aug 2022 23:32:43 +0200 Subject: [PATCH 2/5] iteration 2 + 3.1 --- js/index.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/js/index.js b/js/index.js index 3b92facfa..eb080dc8f 100644 --- a/js/index.js +++ b/js/index.js @@ -10,6 +10,17 @@ console.log("The navigator's name is " + hacker2 + "."); // Iteration 2: Conditionals - +if(hacker1.legth>hacker2.length){ + console.log(`The driver has the longest name, it has ${hacker1.length}characters. `); +} +else if(hacker1.length Date: Sat, 13 Aug 2022 11:08:45 +0200 Subject: [PATCH 3/5] iteration 2 --- js/index.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/js/index.js b/js/index.js index eb080dc8f..1bc1dfe12 100644 --- a/js/index.js +++ b/js/index.js @@ -21,6 +21,11 @@ else{ } // Iteration 3: Loops -for(i=0;i Date: Tue, 16 Aug 2022 18:26:42 +0200 Subject: [PATCH 4/5] 3.2 finished, lab done --- js/index.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/js/index.js b/js/index.js index 1bc1dfe12..424b7ba07 100644 --- a/js/index.js +++ b/js/index.js @@ -29,3 +29,28 @@ console.log(Upper); //3.2 const reverse = hacker2.split("").reverse().join(""); +console.log(reverse); + +//3.3 +let lista = [hacker1,hacker2]; + +lista.sort(); + +if(lista[0]===hacker1){ + + console.log(`The driver's name goes first`); + +} + +else if(lista[0]===hacker2){ + + console.log(`Yo, the navigator goes first definitely`); + +} + +else{ + + console.log(`What?! You both have the same name? `); + +} + From c542af8cb3e26184bb2273aa6eecb5c2e27b8a58 Mon Sep 17 00:00:00 2001 From: laura86bf Date: Thu, 18 Aug 2022 21:18:52 +0200 Subject: [PATCH 5/5] solved --- js/index.js | 292 ++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 236 insertions(+), 56 deletions(-) diff --git a/js/index.js b/js/index.js index 424b7ba07..3d50a349d 100644 --- a/js/index.js +++ b/js/index.js @@ -1,56 +1,236 @@ -// Iteration 1: Names and Input -// -console.log ("I'm ready!"); - -const hacker1 = "Manolo"; -console.log("The driver's name is " + hacker1 + "."); - -const hacker2 = "Google Chrome"; -console.log("The navigator's name is " + hacker2 + "."); - -// Iteration 2: Conditionals - -if(hacker1.legth>hacker2.length){ - console.log(`The driver has the longest name, it has ${hacker1.length}characters. `); -} -else if(hacker1.lengthnumber2){ + return number1; + } + else if(number1 array[i].length){ + + } + else{ + ganador = array[i]; + } + } + return ganador; + } + + let findLongestWordResult = findLongestWord(words); + console.log(`Iteration 2, answer: ${findLongestWordResult}`); + + + + + // Iteration #3: Calculate the sum + const numbers = [6, 12, 1, 18, 13, 16, 2, 1, 8, 10]; + let resultadoSuma=0; + + function sumNumbers(array) { + + for(let i=0;i