Skip to content

Instantly share code, notes, and snippets.

@g-bel
Created May 2, 2022 22:46
Cassidy Williams - question of the week 2021-05-02
dict = ['apple', 'banana', 'cranberry', 'strawberry'];
const simpleAutocomplete = (text) => dict.filter(str => str.includes(text));
console.log(JSON.stringify(simpleAutocomplete('app')));
console.log(JSON.stringify(simpleAutocomplete('berry')));
console.log(JSON.stringify(simpleAutocomplete('fart')));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment