Learn what pure functions are, how side effects impact your JavaScript code, and why they matter for writing predictable, testable programs.
Tutorial series
Javascript Functional Programming
7 tutorials — follow in order for the best learning path.
- Pure Functions and Side Effects
- Higher-Order Functions in JavaScript: map, filter, compose
Learn how JavaScript higher-order functions let you pass and return functions to build reusable, declarative code.
- Understanding Immutability in Modern JavaScript
Learn JavaScript immutability: use spread operators and array methods for immutable updates, structuredClone for deep copies, and keep React state predictable.
- Function Composition and Pipelines
Learn function composition in JavaScript with compose and pipe. Build readable data pipelines from small, reusable functions for clean, maintainable code.
- Currying and Partial Application
Learn how currying and partial application let you transform JavaScript functions into reusable, composable pieces.
- Functors and Monads in JavaScript: From Array.map to Promise Chains
Learn how functors and monads work in JavaScript through Array.map, Promise.then, custom Maybe types, and Either for error handling with composable chains.
- Algebraic Data Types in JavaScript: Product and Sum Types
Learn how algebraic data types work in JavaScript, including product types, sum types, and discriminated unions with TypeScript type narrowing.