From 406aa8c0460f6b79e5a9c5b479946c767f0c0b07 Mon Sep 17 00:00:00 2001 From: Javier Date: Mon, 22 Oct 2018 15:42:23 -0400 Subject: [PATCH] exit :qw --- starter-code/basic-algorithms.js | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/starter-code/basic-algorithms.js b/starter-code/basic-algorithms.js index 82f20d8ba..72d8a3218 100644 --- a/starter-code/basic-algorithms.js +++ b/starter-code/basic-algorithms.js @@ -1,7 +1,20 @@ -// Names and Input - +// Names and Input +let hacker1 = "Travis" +console.log("The drivers name is " +hacker1) +let navigator = "Javier" +console.log("The navigators name is " +navigator) //Conditionals - - +if (hacker1.length > navigator.length) { + console.log(`The driver has the longest name, it has ` + hacker.length + 'characters!'); +} else if (hacker1.length < navigator.length) { + console.log('The Navigator has the longest name, it has ' + navigator.length + 'characters'); +} else if (hacker1.length === navigator.length) { + console.log('Wow! you both got equally long names, ' +hacker1.length + ' characters'); +} // Lorem ipsum generator +console.log(hacker1.toUpperCase().split('')) +function reverse(str){ + return str.split("").reverse().join(""); +} +console.log(reverse(navigator));