jawns317
jawns317

Reputation: 1746

What do you call a function that returns same output as input?

I seem to remember there being a special name for a function whose output is always identical to its input, e.g.:

var whatsMyName = function (a) {
    return a;
};

Does anyone know what such a function -- which, in practice, is pretty pointless -- is called?

Upvotes: 7

Views: 2441

Answers (1)

jwodder
jwodder

Reputation: 57470

It's the identity function.

Upvotes: 13

Related Questions