ArchicionadoArchicionado

Functional Programming

PRACTITIONER
This item has not been updated recently. Check its ring classification to assess its current relevance.
Adopt

There are two main things you need to know to understand the concept:

  • Data is immutable: If you want to change data, such as an array, you return a new array with the changes, not the original.
  • Functions are stateless: Functions act as if for the first time, every single time! In other words, the function always gives the same return value for the same arguments.

There are three best practices that you should generally follow:

  1. Your functions should accept at least one argument.
  2. Your functions should return data, or another function.
  3. Don’t use loops!