In programming (especially in functional languages), a lambda function (also anonymous function) is a user-defined function without an identifier (i.e., nameless). They’re useful mainly to be passed to higher-order functions or to construct the result of a higher-order function.
Mathematically speaking, lambda functions mainly come from the idea of lambda calculus, where all functions are anonymous.
Language-specific
In Python
In Python, we can declare lambda functions as follows:
In C++
Since C++11, we can construct lambdas with: