identity

A function which returns its value unmodified.

Arguments

  1. x (Any): The value to return.

Returns

(Any): The value given as the parameter.

Example

var identity = Rx.helpers.identity;

// Returns its value
var x = identity(42);
console.log(x);
// => 42

Last updated

Was this helpful?