README
F-bind
Library mimicking the proposed function-bind operator (::
)
Using bind operator
const {unique} = require('some-array-extras-lib')
console.log(
[1, 2, 2, 4]
::unique() // call custom method
.filter(n => n % 2 == 0) // call native method
.map(n => n * 10)
) // prints [20, 40]
Using f-bind library
const {unique} = require('some-array-extras-lib')
const $ = require('f-bind')
console.log(
$([1, 2, 2, 4]) // wrap
.$(unique)() // call custom method
.$('filter')(n => n % 2 == 0) // call native method
.$('map')(n => n * 10)
.$() // unwrap
) // prints [20, 40]