Skip to content

Instantly share code, notes, and snippets.

View omnidan's full-sized avatar
📚
published "Learn React Hooks"!

Daniel Bugl omnidan

📚
published "Learn React Hooks"!
View GitHub Profile
@omnidan
omnidan / 0_reuse_code.js
Created March 16, 2016 15:14
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
const arg1 = (arg) => arg !== 1
const arg2 = (arg) => arg !== 2
function combineFilters (filters) {
return filters.reduce((prev, curr) =>
(arg) => prev(arg) && curr(arg)
, () => true)
}
console.log(combineFilters([arg2, arg1, arg1])(1)); // false