K

K(argument) -> argument

K is Prototype’s very own identity function, i.e. it returns its argument untouched.

This is used throughout the framework, most notably in the Enumerable module as a default value for iterators.

Examples


Prototype.K('hello world!');
// -> 'hello world!'

Prototype.K(1.5);
// -> 1.5

Prototype.K(Prototype.K);
// -> Prototype.K