Introduction to functional programming in TypeScript