Skip to content

Instantly share code, notes, and snippets.

@yabusaio
yabusaio / filterArray.js
Created February 28, 2021 11:43 — forked from jherax/arrayFilterFactory.1.ts
Filters an array of objects with multiple match-criteria.
/**
* Filters an array of objects using custom predicates.
*
* @param {Array} array: the array to filter
* @param {Object} filters: an object with the filter criteria
* @return {Array}
*/
function filterArray(array, filters) {
const filterKeys = Object.keys(filters);
return array.filter(item => {
@yabusaio
yabusaio / 0_reuse_code.js
Created March 30, 2017 05:40
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console