-
Notifications
You must be signed in to change notification settings - Fork 5.8k
[BCN-FT-012020]-Tarek #673
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
Conversation
} | ||
console.log(result2); | ||
|
||
for(var i=0;i<=hacker1;i++){ |
There was a problem hiding this comment.
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++)
} | ||
|
||
} | ||
} |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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();
There was a problem hiding this 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 👍
Day 1 exercise JS.