Skip to content
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 .DS_Store
Binary file not shown.
35 changes: 32 additions & 3 deletions starter-code/basic-algorithms.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,36 @@
// Names and Input
const hacker1 = 'Kayne';
console.log('The drivers name is ', hacker1);

const hacker2 = 'Dylan';
console.log('The navigators name is', hacker2);

//Conditionals
var hL1 = hacker1.length;
var hL2 = hacker2.length;

if (hL1 > hL2){
console.log('The Driver has the longest name, it has', hacker1.length, 'characters')
}else if (hL2 > hL1){
console.log('Yo, navigator got the longest name, it has', hacker2.length, 'characters')
}else {
console.log('wow, you both got equally long names,', hacker1.length ,'characters!!')
};

// Lorem ipsum generator
console.log(hacker1.toUpperCase().split('').join(' '));

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

/*
var fh = hacker1.charAt(0);
var sh = hacker2.charAt(0);

var orderLetters = [fh, sh];
var sort = orderLetters.sort(fh, sh)
*/

if ('Kayne'<'Dylan'){
console.log('The drivers name goes first');
}else if ('Kayne'>'Dylan'){
console.log('Yo, the navigator goes first definitely');
}else if ('Kayne'=='Dylan'){
console.log('What?! You both got the same name?');
}