diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000000000..cbb7b3af2 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "liveServer.settings.port": 5502 +} \ No newline at end of file diff --git a/README.md b/README.md index 71ce09db5..c2339b611 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ This exercise allows you to practice and apply the concepts and techniques taught in class. - Upon completion of this exercise, you will be able to: + Upon completion of this exercise, you will be able to: - Run JavaScript code from your IDE, using a local server to load it in the browser - Declare variables using `const` and `let` keywords and use them to store values. diff --git a/index.js b/index.js index 6b0fec3ad..abfa186ce 100644 --- a/index.js +++ b/index.js @@ -1,7 +1,27 @@ // Iteration 1: Names and Input +const hacker1 = "Jane"; +const hacker2 = "Tom" +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 (hacker1.length < hacker2.length){ + console.log(`Yo, the navigator goes first, definitely.`) +} +else{ + console(`Wow, you both have equally long names, ${hacker1.length}, ${hacker2.length} characters!`) +} + // Iteration 3: Loops + +console.log(hacker1.toUpperCase().slice("")) + +console.log(hacker2.split("").reverse().join("")) \ No newline at end of file