Function definitions
Functions
// Example: create a function which takes a number 'n' as argument
// and returns n squared.
function square(n: number) {
return n * n;
}
return square(4);// Example: a function with an explicit return type.
function square(n: number) : number {
return n * n;
}
return square(3);Self functions
Lambda expressions
Advanced: Variadic functions
Advanced: Generic functions
Advanced: Function composition using the >> operator
Advanced: Partial function calls using the _ operator
Last updated
Was this helpful?