code: function createFilterFor(query) {
        var lowercaseQuery = query.toLowerCase();
  
        return function filterFn(state) {
          return (state.value.indexOf(lowercaseQuery) === 0);
        };
  
      }
docs: Create filter function for a query string