Skip to content

[BCN-FT-012020]-Tarek - #673

Closed
Fiend-Shadow wants to merge 4 commits into
ironhack-labs:masterfrom
Fiend-Shadow:master
Closed

[BCN-FT-012020]-Tarek#673
Fiend-Shadow wants to merge 4 commits into
ironhack-labs:masterfrom
Fiend-Shadow:master

Conversation

@Fiend-Shadow

Copy link
Copy Markdown

Day 1 exercise JS.

Comment thread js/index.js
}
console.log(result2);

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

Copy link
Copy Markdown
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++)

Comment thread js/index.js
}

}
}

Copy link
Copy Markdown
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

Comment thread js/index.js
var result1="";
for (var i=0;i<hacker1.length;i++){

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

@tawebbcn tawebbcn Jan 14, 2020

Copy link
Copy Markdown
Contributor

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();

@tawebbcn tawebbcn left a comment

Copy link
Copy Markdown
Contributor

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