TypeScript
// multiply(a, b): b should default to 2 when omitted.
function multiply(a: number, b: number = 2): number {

}

// Type operation as a function taking two numbers and returning a number.
const operation: (a: number, b: number) => number = multiply;

const doubled = operation(5);
const custom = operation(5, 3);