Functional programming is a programming paradigm that's been gaining a lot of traction in JavaScript. One of the core concepts of functional programming is pure functions and writing declarative vs. imperative code. In this article, I'll define what pure functions are, why they're beneficial, and how to construct them.Pure functions consist of the following two concepts:Given the same inputs, the function will always return the same output. The function should not modify anything outside of its scope.

3m read timeFrom blog.alyssaholland.me
Post cover image
Table of contents
What are Pure Functions?Side EffectsBenefits of Pure FunctionsPure vs. Impure FunctionsCan Every Function be Pure?

Sort: