diff --git a/js/index.js b/js/index.js index 83d37abb4..3c8068854 100644 --- a/js/index.js +++ b/js/index.js @@ -10,5 +10,12 @@ console.log(`The navigator's name is ${hacker2}`); // Iteration 2: 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(`It seems that the navigator has the longest name, it has ${hacker2.length} characters.`); +} else { + console.log(`Wow, you both have equally long names, ${hacker1.length} characters!`); +} // Iteration 3: Loops \ No newline at end of file