Class: _

_

new _()

index.js, line 1
FuncDash

Methods

static_.and(left, right){Boolean}

logic/and.js, line 20
Logical AND. Returns true if both arguments are true.
Name Type Description
left * The left side of the AND
right * The right side of the AND
Returns:
Type Description
Boolean Returns the result of a logical AND.
Example
_.and(true, true);
// => true

_.and(true, false);
// => false

static_.apply(func, args){*}

function/apply.js, line 19
Apply a function with the given array as arguments.
Name Type Description
func function The function to be applied.
args Array The Array to be used as arguments.
Returns:
Type Description
* Returns the result of the function.
Example
_.apply(_.add, [1, 2]);
// => 3

static_.call(func, args){*}

function/call.js, line 20
Call a function with the given arguments.
Name Type Description
func function The function to be called.
args * repeatable The arguments of the function call.
Returns:
Type Description
* Returns the result of the function.
Example
_.call(_.add, 1, 2);
// => 3

static_.ifElse(condition, onTrue, onFalse){*}

logic/ifElse.js, line 28
A functional branch similar to an if/else statement. If the condition function is true, call the onTrue function and return the result. If the condition function if false, call the onFalse function and return the result.
Name Type Description
condition function The condition to determine the truthy value
onTrue function The function to call if condition is true.
onFalse function The function to call if condition is false.
Returns:
Type Description
* Returns the result of onTrue or onFalse.
Example
var add2 = _.ifElse(_.isNumber, _.partial(_.add, 2), _.constant(0));
add2()
// => 0
add2(3)
// => 5

static_.mapInvoke(functions){function}

function/mapInvoke.js, line 23
Creates a function that when called will return an array of results from invoking each argument function with arguments.
Name Type Description
functions function optional repeatable The functions to be invoked.
Returns:
Type Description
function Function that when called, returns an Array with each result of each function invoked with the given arguments.
Example
var invoker = _.mapInvoke(_.add, _.multiply);
invoker(3, 5);
// => [8, 15]

static_.multiply(multiplier, multiplicand){Number}

math/multiply.js, line 17
Multiplies two numbers.
Name Type Description
multiplier Number The first number to multiply.
multiplicand Number The second number to multiply.
Returns:
Type Description
Number Returns the product.
Example
_.multiply(6, 4);
// => 24

static_.not(value){Boolean}

logic/not.js, line 19
Logical NOT. Returns the inverse of the truthiness of a value.
Name Type Description
value * The value to NOT
Returns:
Type Description
Boolean Returns the result of a logical NOT.
Example
_.not(true);
// => false

_.not(false);
// => true

static_.or(left, right){Boolean}

logic/or.js, line 20
Logical OR. Returns true if at least one argument is true.
Name Type Description
left * The left side of the OR
right * The right side of the OR
Returns:
Type Description
Boolean Returns the result of a logical OR.
Example
_.or(true, false);
// => true

_.or(false, false);
// => false

static_.product(collection){Number}

math/product.js, line 21
Gets the product of the values in `collection`.
Name Type Description
collection Array | Object | String The collection to iterate over.
Returns:
Type Description
Number Returns the product.
Example
_.product([4, 6, 2]);
// => 48

_.sum({ 'a': 4, 'b': 6, 'c': 2 });
// => 48