bingo-functional-js
Version:
A port of the PHP bingo-functional library
17 lines (14 loc) • 322 B
JavaScript
const head = require('../Collection/head')
/**
* constantFunction
*
* constantFunction :: a -> b -> (() -> a) -> a
* @param {any...} args
* @returns {function}
* @example
*
* constantFunction('foo', 3)()
* // => 'foo'
*/
const constantFunction = (...args) => () => head(args)
module.exports = constantFunction