Skip to content
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

Refactoring For loop #5

Merged
merged 2 commits into from Jan 7, 2018
Merged

Refactoring For loop #5

merged 2 commits into from Jan 7, 2018

Conversation

ghost
Copy link

@ghost ghost commented Dec 27, 2017

A refactoring in order to remove a for loop and possibly optimize this a bit.

A refactoring in order to remove a for loop and possibly optimize this a bit.
lib/commands.js Outdated
var lowerCaseCommands = commands.map(function (item) {
return item.toLowerCase();
});
return lowerCaseCommands.indexOf(command) !== -1 ? true : false;
Copy link

Choose a reason for hiding this comment

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

The ternary operator is unnecessary here.

Added that for readability since its a common idiom of the JS language
@ghost
Copy link
Author

ghost commented Dec 28, 2017

@fentas Added edits to the PR

@justinvforvendetta
Copy link
Member

that does look much nicer. sorry i just saw this!

@justinvforvendetta justinvforvendetta merged commit b859c0d into vergecurrency:master Jan 7, 2018
@ghost
Copy link
Author

ghost commented Jan 7, 2018

@justinvforvendetta No worries! I know you're swamped! I'd love to become a collaborator to Verge in any way that I could. Let me know if you all need help with anything always love developing PHP and JS. I thought about making this into an npm module that your could download, but I wanted to wait to clear with you all first 👍

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