Create a function which always returns a given value.
npm install fj-always --save
var always = require('fj-always');
var sayHello = always('hello');
sayHello(); // => 'hello'
sayHello(true); // => 'hello'
sayHello(false); // => 'hello'
sayHello('foo'); // => 'hello'
Return always a given value.
always(value)
Parameters
Name | Type | Description |
---|---|---|
value | * | The value that should be returned always |
Returns
Type | Description |
---|---|
function | A function that always returns value |