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));