Skip to content

Akua_Shaul_basic_algorithms#616

Closed
akups wants to merge 3 commits into
ironhack-labs:masterfrom
akups:master
Closed

Akua_Shaul_basic_algorithms#616
akups wants to merge 3 commits into
ironhack-labs:masterfrom
akups:master

Conversation

@akups

@akups akups commented Jan 6, 2020

Copy link
Copy Markdown

No description provided.

Comment thread js/index.js
const hacker2 = "Akua";
console.log(hacker2);
if (hacker1.length > hacker2.length) {
console.log(hacker1);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

add a text, so say hacker1's name is longer (or something similar)

Comment thread js/index.js
reverseNavigator += hacker1[i];
}

console.log(reverseNavigator);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍

Comment thread js/index.js
console.log(`${hacker1}'s name goes first.`);
} else if (hacker1 > hacker2) {
console.log(`Yo, ${hacker2} goes first definitely.`);
} else console.log(`What?! You both have the same name?`);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I would use localeCompare() in order to sort by lexicographical order. Simply checking which string is bigger will not always work to sort by lexicographical order.

@stale

stale Bot commented Feb 6, 2020

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it didn't have any recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale Bot added the stale label Feb 6, 2020
@stale

stale Bot commented Feb 8, 2020

Copy link
Copy Markdown

This pull request is closed. Thank you.

@stale stale Bot closed this Feb 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants