Last active
January 20, 2020 21:59
-
-
Save johnloy/b911e4042c10a768878d3e1201eb898d to your computer and use it in GitHub Desktop.
Unbound array function in JS using Function.prototype.bind
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const filter = Function.prototype.call.bind(Array.prototype.filter) | |
filter([1,2,3], (x) => x > 1 ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Explanation at https://stackoverflow.com/questions/37368720/javascript-call-and-prototype-slice-function