« Back
Sammy.Store filter ( callback )
Filters the store by a filter function that takes a key value. Returns an array of arrays where the first element of each array is the key and the second is the value of that key.
Example
var store = new Sammy.Store;
store.set('one', 'two');
store.set('two', 'three');
store.set('1', 'two');
var returned = store.filter(function(key, value) {
// only return
return value === 'two';
});
// returned => [['one', 'two'], ['1', 'two']];
comments powered by Disqus