From 5d65b87e788bedcd11eaa2f21040d30f22ec5d5d Mon Sep 17 00:00:00 2001 From: Jaime Hidalgo Fernandez Date: Thu, 16 Jan 2020 17:36:17 +0100 Subject: [PATCH] done --- .DS_Store | Bin 0 -> 6148 bytes js/index.js | 37 ++++++++++++++++++++++++++++++++++--- 2 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..7da814f420d51a6316a6e04094149240f7c19274 GIT binary patch literal 6148 zcmeHK&2G~`5S~o~T?Zj@sMH?!g49D)rG&PJs*(xmp$8;{D|#rXwQ)p^TyGUSL=aN> zHQG1mqwoYg4$SNhRe#`GQ8XjXezUtXYwu@kX9oaOf1IuYv;jb)5;g*C{vb3@dP^ES z(nM6WMv~hEZCY%T=LG(32I$*0;1iTPx&3hC`z`-;;x^!Xl1X{OKHrm*JS(ei_lIiC zH6J{j*Se)!k6Z7fBRh$zxEh!Jc(hNw*Ku`}u)S+-erdLnr>k2# zhsR&OPQT4g&piJMe^4h+7=Ob#8g6r+qfwFD;v@FSH-I;=4KH8-uMk(@7}6UQU7*)h zim)pp3G34ln~NGE91^`Bx4 zW5`&0#2FOjLlJ$b;u1soa2z-67c$l!eK;sCJ`_J$afPDX({X*{+(CsNr4QEB;;3nybM9ZrDF7@RJ?@h a1jh{-h#_O`5l2wuBH(C{Mi{tL27Un!Ok@B6 literal 0 HcmV?d00001 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.`) +}