Functional programming (FP)
Functional programming is a paradigm focused on functions. It’s okay if you are unfamiliar with functional programming because JAX mainly centers around just one of its key features.
Pure functions are similar to mathematical functions and have the following properties:
- Identical outputs: No matter how many times we run the function, it gives the same output for the same tuple of inputs.
- No side-effects: The function doesn’t change any variable other than variables in its local scope.
Here is a basic example of a pure function: