Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

function

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?

like image 211
jawns317 Avatar asked Oct 04 '11 16:10

jawns317


1 Answers

It's the identity function.

like image 108
jwodder Avatar answered Oct 06 '22 12:10

jwodder