From d747421004bb91585257683908b43bb6018dc04d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Miri?= Date: Mon, 7 Jan 2019 18:13:21 +0100 Subject: [PATCH] done --- starter-code/basic-algorithms.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/starter-code/basic-algorithms.js b/starter-code/basic-algorithms.js index 82f20d8ba..888556d40 100644 --- a/starter-code/basic-algorithms.js +++ b/starter-code/basic-algorithms.js @@ -1,7 +1,27 @@ // Names and Input +var hacker1 = "Kevin"; +console.log("The driver’s name is " + hacker1); +var hacker2 = "Estelle"; +console.log("The navigator’s name is " + hacker2); + //Conditionals +if ( hacker1.length > hacker2.length ){ + console.log("The Driver has the longest name, it has " + hacker1.length + "characters"); + } + else if (hacker2.length > hacker1.length ){ + console.log("Yo, navigator got the longest name, it has " + hacker2.length + " characters"); + } + else { + console.log("wow, you both got equally long names, " + hacker2.length + "characters!!"); + }; + + var UpperCase = "" + for (var i = 0; i <=hacker1.length -1; i++) { + console.log(hacker1[i] + " " ); + } + // Lorem ipsum generator