Done - #654
Conversation
| console.log(`It seems that the navigator has the longest name, it has ${hacker2.length} characters.`) | ||
|
|
||
| } | ||
| else if (hacker1.length === hacker2.length) { |
There was a problem hiding this comment.
You can also just use an "else" statement here
| nameReverseOrder = ''; | ||
| } | ||
| console.log(nameWithSpaces); | ||
| for (let j = hacker2.length -1; j > 0; j-- ) { |
There was a problem hiding this comment.
in the for loop, you should use "j>=0" otherwise the first letter won't print.
| for (let i = 0; i < hacker1Uppercase.length; i++) { | ||
| console.log(hacker1Uppercase[i] ); | ||
| nameWithSpaces += `${hacker1Uppercase[i]} `; | ||
| nameReverseOrder = ''; |
There was a problem hiding this comment.
If you're not using it inside the loop, It's better to define nameReverseOrder in the global scope.
| // Lexical order | ||
|
|
||
|
|
||
| if (hacker1 === hacker2) { |
There was a problem hiding this comment.
I think you meant to use "hacker1.length === hacker2.length"
|
|
||
| } | ||
|
|
||
| else if (hacker1.localeCompare(hacker2) === -1) { |
There was a problem hiding this comment.
Again you can use the ".length" property here
| } | ||
|
|
||
| else if (hacker1.localeCompare(hacker2) === 1) { | ||
|
|
There was a problem hiding this comment.
Again you can use the ".length" property here
|
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. |
|
This pull request is closed. Thank you. |
No description provided.