[JavaScript] Purity

Cheling Liao
Coding Cheling
Published in
1 min readFeb 21, 2020

1. Deterministic always produces the same results given the same inputs

2. No Side Effects It does not depend on any state, or data, change during a program’s execution. It must only depend on its input elements.

Do this and thinks like this.

Not like this.

--

--