Skip to content

Conversation

@audiomuse1
Copy link

No description provided.

for(var i = 0; i < theArray.length; i++){
var currentItem = theArray[i];
var returnedItem = fnc(currentItem);
if (returnedItem = true) {
Copy link
Contributor

Choose a reason for hiding this comment

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

double check your use of javascript code
how do you compare something to true

var returnedItem = fnc(currentItem);
if (returnedItem = true) {
return returnedItem;
} else {
Copy link
Contributor

Choose a reason for hiding this comment

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

For the most part, you don't ever want to have an else statement in a loop

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