wanghy6503
7/16/2019 - 6:55 AM

Typescript Pure Function Example

const myPureFunction = (x: number) => x * 2 + 1;

console.log(myPureFunction(1)); // (1 * 2) + 1 = 3
console.log(myPureFunction(2)); // (2 * 2) + 1 = 5