Skip to content

[LIS - WDFT - APR23] Victoria Avelar #28

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

avelarvicky
Copy link

No description provided.

Copy link

@brunorocha20 brunorocha20 left a comment

Choose a reason for hiding this comment

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

Good job on the lab, Victoria. Check the comments for a better understanding.



//separated by spaces
const hacker1InCaps = hacker1.toUpperCase();

Choose a reason for hiding this comment

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

In this case, the lab is asking us to use loops for this iteration.
Separating the word with spaces, can be done using a for loop.
Here's a possible solution you could've used:

let driver = '';
for (let i = 0; i < hacker1.length; i++) {
  driver = driver + hacker1[i] + ' ';
}

console.log(driver.toUpperCase());

//lexicographic order
let lexicographicOrder = (hacker1.localeCompare(hacker2))

if (lexicographicOrder = -1) {

Choose a reason for hiding this comment

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

Don't forget that when you want to compare, you should almost every time use the === operator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants