Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

dev-mexpt2 Roberto#312

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
rpernicone wants to merge2 commits intoironhack-labs:masterfromrpernicone:master
Closed
Show file tree
Hide file tree
Changes fromall 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
View file
Open in desktop
Binary file not shown.
35 changes: 32 additions & 3 deletionsstarter-code/basic-algorithms.js
View file
Open in desktop
Original file line numberDiff line numberDiff 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?');
}

[8]ページ先頭

©2009-2025 Movatter.jp