Last active
April 23, 2019 20:09
-
-
Save ConnectedReasoning/b174456b839a1cb15c118c3e6a861a8b to your computer and use it in GitHub Desktop.
Filter a list of things by filter word
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const filterThings = (filter_word, things) =>{ | |
//console.log('filtering on ', filter_word); | |
let filteredThings = things.filter(thing => { | |
return thing.startsWith(filter_word); | |
}); | |
return filteredThings.sort(); | |
} | |
export default filterThings; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment