class method Prototype.K

View source on GitHub →

Prototype.K(argument) → argument
  • argument (Object) – Optional argument...

Prototype.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(200);
// -> 200
 Prototype.K(Prototype.K);
// -> Prototype.K