Skip to content

Added Functions That Search Driver Array by Name #11

Open
Lsimmons98 wants to merge 2 commits intolearn-co-curriculum:masterfrom
Lsimmons98:workingBranch
Open

Added Functions That Search Driver Array by Name #11
Lsimmons98 wants to merge 2 commits intolearn-co-curriculum:masterfrom
Lsimmons98:workingBranch

Conversation

@Lsimmons98
Copy link

Used .filter() to search through driver array.

Copy link

@stephenmckeon stephenmckeon left a comment

Choose a reason for hiding this comment

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

SWEET.

Comment on lines +1 to +10
const drivers = ['Bobby', 'Sammy', 'Sally', 'Annette', 'Sarah', 'Bobby']




const findMatching = (array, string) => {
const stringCap = string.toUpperCase()
return array.filter((item) => item.toUpperCase() === stringCap);

}

Choose a reason for hiding this comment

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

Suggested change
const drivers = ['Bobby', 'Sammy', 'Sally', 'Annette', 'Sarah', 'Bobby']
const findMatching = (array, string) => {
const stringCap = string.toUpperCase()
return array.filter((item) => item.toUpperCase() === stringCap);
}
const drivers = ['Bobby', 'Sammy', 'Sally', 'Annette', 'Sarah', 'Bobby']
const findMatching = (array, string) => {
const stringCap = string.toUpperCase()
return array.filter((item) => item.toUpperCase() === stringCap);
}

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