Skip to content

Instantly share code, notes, and snippets.

@ConnectedReasoning
Last active April 23, 2019 20:09
Show Gist options
  • Save ConnectedReasoning/b174456b839a1cb15c118c3e6a861a8b to your computer and use it in GitHub Desktop.
Save ConnectedReasoning/b174456b839a1cb15c118c3e6a861a8b to your computer and use it in GitHub Desktop.
Filter a list of things by filter word
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