Skip to content

Instantly share code, notes, and snippets.

@brownsmith
Created Feb 14, 2018
Embed
What would you like to do?
Little note on pure functions
// A function is only pure if, given the same input, it will always produce the same output.
const highpass = (cutoff, value) => value >= cutoff;
highpass(5, 123); // true
highpass(5, 6); // true
highpass(5, 18); // true
highpass(5, 5); // true
highpass(5, 1); // false
highpass(5, 3); // false
highpass(5, 4); // false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment