Skip to content

Conversation

Fiend-Shadow
Copy link

Day 1 exercise JS.

}
console.log(result2);

for(var i=0;i<=hacker1;i++){
Copy link
Contributor

Choose a reason for hiding this comment

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

In your loop, you should initiate it this way (var i=0; i<hacker1.length; i++)

}

}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

For this iteration, it doesn't work properly, you should compare each letter with the localCompare method

var result1="";
for (var i=0;i<hacker1.length;i++){

result1=result1+" "+hacker1[i].toUpperCase();
Copy link
Contributor

@tawebbcn tawebbcn Jan 14, 2020

Choose a reason for hiding this comment

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

To avoid to repeat, you can use the operator += like the following example:
result1 += " "+hacker1[i].toUpperCase();

Copy link
Contributor

@tawebbcn tawebbcn 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 in general, review the operator to avoid to repeat,
Great 👍

@tawebbcn tawebbcn closed this Jan 14, 2020
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
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