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
21 changes: 17 additions & 4 deletions starter-code/basic-algorithms.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
// Names and Input


// Names and Input
let hacker1 = "Travis"
console.log("The drivers name is " +hacker1)
let navigator = "Javier"
console.log("The navigators name is " +navigator)
//Conditionals


if (hacker1.length > navigator.length) {
console.log(`The driver has the longest name, it has ` + hacker.length + 'characters!');
} else if (hacker1.length < navigator.length) {
console.log('The Navigator has the longest name, it has ' + navigator.length + 'characters');
} else if (hacker1.length === navigator.length) {
console.log('Wow! you both got equally long names, ' +hacker1.length + ' characters');
}
// Lorem ipsum generator
console.log(hacker1.toUpperCase().split(''))
function reverse(str){
return str.split("").reverse().join("");
}
console.log(reverse(navigator));