Lambdas are values that represent functions. They are defined using the -> (arrow) operator.
(a, b) -> expression(Single expression return)(a) -> { ... }(Multi-statement block)async (a, b) -> { ... }(Asynchronous lambda)
let add = (a, b) -> a + b
let result = add(5, 10)
fn runCallback(cb) {
cb()
}
runCallback(() -> {
print("Callback executed!")
})
let fetchData = async () -> {
const (data, err) = await Network.get("https://api.example.com");
return data;
}