Skip to content

Conversation

zahnk
Copy link

@zahnk zahnk commented Nov 18, 2019

No description provided.

console.log(`The driver has the longest name, it has ${hacker1.length} characters`);
else if (hacker1.length < hacker2.length)
console.log(`It seems that the navigator has the longest name, it has ${hacker2.length} characters`);
else

Choose a reason for hiding this comment

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

prefer an explicit condition like " === "

let str = "";

for (let i = 0; i < hacker1.length; i++) {
str = str + hacker1.charAt(i) + " ";

Choose a reason for hiding this comment

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

prefer hacker1[i]

let str2 = "";

for (let i = hacker2.length - 1; i >= 0; i--) {
str2 = str2 + hacker2.charAt(i);

Choose a reason for hiding this comment

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

prefer hacker2[i]

console.log(`The driver's name goes first`);
else if (hacker1 > hacker2)
console.log(`Yo, the navigator goes first definitely.`);
else
Copy link

@MarcoSantonastasi MarcoSantonastasi Nov 19, 2019

Choose a reason for hiding this comment

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

prefer explicit condition like " = "


for (let i = 0; i <= text.length; i++) {

Choose a reason for hiding this comment

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

ERROR: correct to i < text.length

let found = 0;

Choose a reason for hiding this comment

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

Could be greatly simplified. Please read documentation about indexOf()

Copy link

@MarcoSantonastasi MarcoSantonastasi left a comment

Choose a reason for hiding this comment

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

Good.
Iteration 3: prefer localeCompare() as per instructions
Some minor comments


let str = "";

for (let i = 0; i < hacker1.length; i++) {

Choose a reason for hiding this comment

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

prefer use of localeCompare() as per lesson instructions

@stale
Copy link

stale bot commented Dec 19, 2019

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 Dec 19, 2019
@stale
Copy link

stale bot commented Dec 21, 2019

This pull request is closed. Thank you.

@stale stale bot closed this Dec 21, 2019
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
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy