Created: 2023-09-06 10:27
Status: #concept
Subject: Programming
Tags: Java Function Arrow Function IIFE Expression JavaScript Array Functional Programming
Lambda Expression
Java
They are typically used in manipulating streams with java.util.Stream methods which return another
Stream<E>
.
input -> output
JavaScript / TypeScript
input => output
(input: InputType): OutputType => { return output }
Python
lambda input : output
lambda i, j : i * j
# filter(function, iterable)
list1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
list(filter(lambda x: x % 2 == 0, list1))