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
Show file tree
Hide file tree
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
Binary file added BIN +6 KB .DS_Store
Binary file not shown.
37 changes: 34 additions & 3 deletions 37 js/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,38 @@
// Iteration 1: Names and Input
//Iteración 1: Nombres y entrada

let hacker1 = "luciano";
console.log(`the driver´s name is ${hacker1}`);

// Iteration 2: Conditionals
let hacker2= "jaime";
console.log(`The navigator's name is ${hacker2}`)


// Iteration 3: Loops
//Iteración 2: condicionales


if(hacker1.length > hacker2.length){
console.log(`It seems that the navigator has the longest name, it has ${hacker1.length} characters.`)
}
else if (hacker1.length < hacker2.length){
console.log(`It seems that the navigator has the longest name, it has ${hacker2.length} characters.`)
}
else if (hacker1.length = hacker2.length){
console.log(`Wow, you both have equally long names, it has ${hacker1.length} characters.`)
}

//Iteración 3: Bucles


console.log(hacker1.split("").join(" ").toUpperCase());

console.log(hacker2.split("").reverse().join(""));

if(hacker1.localeCompare(hacker2)==0){
console.log(`What?! You both have the same name?`)
}
else if(hacker1.localeCompare(hacker2)<0){
console.log(`The driver's name goes first.`)
}
else if(hacker1.localeCompare(hacker2)>0){
console.log(`Yo, the navigator goes first definitely.`)
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.