Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions starter-code/basic-algorithms.js
Original file line number Diff line number Diff line change
@@ -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 = ""
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you didn't quiet finish this bit- you're not making it uppercase (yet)

you could either make it uppercase on each iteration, or do it after the loop on the final string

for (var i = 0; i <=hacker1.length -1; i++) {
console.log(hacker1[i] + " " );
}

// Lorem ipsum generator