Functional code is characterised by one thing: the absence of side effects. It doesn’t rely on data outside the current function, and it doesn’t change data that exists outside the current function. Every other “functional” thing can be derived from this property.
- Don’t iterate over lists. Use map and reduce.
- Write declaratively, not imperatively.