Skip to content

Added Functions That Search Driver Array by Name #11

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

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

Conversation

@Lsimmons98

Copy link
Copy Markdown

Used .filter() to search through driver array.

@stephenmckeon stephenmckeon left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

SWEET.

Comment thread index.js
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);

}

Copy link
Copy Markdown

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