diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 000000000..7da814f42 Binary files /dev/null and b/.DS_Store differ diff --git a/js/index.js b/js/index.js index dd8ff0062..0757d5503 100644 --- a/js/index.js +++ b/js/index.js @@ -1,7 +1,38 @@ -// Iteration 1: Names and Input +//Iteración 1: Nombres y entrada +let hacker1 = "luciano"; +console.log(`the driver´s name is ${hacker1}`); -// Iteration 2: Conditionals +let hacker2= "jaime"; +console.log(`The navigator's name is ${hacker2}`) -// Iteration 3: Loops \ No newline at end of file +//Iteración 2: condicionales + + + if(hacker1.length > hacker2.length){ + console.log(`It seems that the navigator has the longest name, it has ${hacker1.length} characters.`) + } + else if (hacker1.length < hacker2.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, it has ${hacker1.length} characters.`) + } + +//Iteración 3: Bucles + + +console.log(hacker1.split("").join(" ").toUpperCase()); + +console.log(hacker2.split("").reverse().join("")); + +if(hacker1.localeCompare(hacker2)==0){ + console.log(`What?! You both have the same name?`) +} +else if(hacker1.localeCompare(hacker2)<0){ + console.log(`The driver's name goes first.`) +} +else if(hacker1.localeCompare(hacker2)>0){ + console.log(`Yo, the navigator goes first definitely.`) +}