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

Johnny Burke, Kiyohide Hayashi - Berlin - W1D1 Lab#609

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
JohnnyAL wants to merge1 commit intoironhack-labs:masterfromJohnnyAL:master
Closed
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
36 changes: 34 additions & 2 deletionsjs/index.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,39 @@
// Iteration 1: Names and Input

console.log("I'm Ready!")
let hacker1 = "Johnny";
console.log(`The driver's name is ${hacker1}`);
let hacker2 = "Kiyo";
console.log(`The navigator's name is ${hacker2}`);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Nice job! No comments on this iteration

// Iteration 2: Conditionals
if (hacker1.length === hacker2.length) {
console.log(`Wow, you both have equally long names, ${hacker1.length} characters!`);
} else if (hacker1.length > hacker2.length) {
console.log(`The driver has the longest name. It has ${hacker1.length} characters.`);
} else {
console.log(`It seems that the navigator has the longest name, it has ${hacker2.length} characters.`);
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Nice job as well here! All good
On a small note, on the conditionals, try to leave the else condition for the "===" in this case, and the other if statements for the "<" and ">" options. As I said the code is still good but it could be more readable for other partners the other way.

// Iteration 3: Loops
let driverNameCaps = ""

for (let i = 0; i < hacker1.length; i++) {
driverNameCaps += hacker1[i].toUpperCase() + " "
}
console.log(driverNameCaps);

let navNameReverse = ""

for (let i = hacker2.length - 1; i >= 0; i--) {
navNameReverse += hacker2[i]
}

console.log(navNameReverse);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

All good in this iteration!
No comments :D

// Iteration 3: Loops
if (hacker1.localeCompare(hacker2)) {
console.log("The driver's name goes first.")
} else if (hacker.localeCompare(hacker1)) {
console.log("Yo, the navigator goes first definitely.");
} else {
console.log("What?! You both have the same name?");
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

All good as well here!
No comments! :D


[8]ページ先頭

©2009-2025 Movatter.jp