Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
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
22 changes: 19 additions & 3 deletions 22 starter-code/basic-algorithms.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
// Names and Input
var hacker1 = prompt("Who is the name of driver`s:", "") ;
console.log("The driver's name is "+ hacker1);
var hacker2 = prompt("Who is the name of navigator`s", "") ;
console.log("The navigator's name is " + hacker2);
i = hacker1.length;
j = hacker2.length;


//Conditionals
if ( hacker1.length < hacker2.length ){
console.log("Yo, navigator got the longest name, it has "+ (j) +" characters");
} else if (hacker1.length === hacker2.length){
console.log("wow, you both got equally long names, "+ (i) +" characters!!");

} else{
console.log("The Driver has the longest name, it has "+ (i) +" characters");
}
console.log( hacker1.toUpperCase());


// Lorem ipsum generator
console.log(hacker1.charAt());
for (i = 0; i <= hacker1.length; i++){
console.log(hacker1.charAt(i-1));
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.