One of the biggest causes of side-effects was the possibility of a function modifying either global objects or its arguments themselves. All non-primitive objects are passed as references, so when/if you modify them, the original objects will be changed. If we want to stop this (without just depending on the goodwill and clean coding of our developers) we may want to consider some straightforward JS techniques to disallow those side-effects.
A common source of unexpected problems comes from the fact that several JS methods actually modify the underlying object. In this case, by merely using them, you will be causing a side-effect, which you may even not recognize. Arrays are the basic source of problems and the list of troublesome methods is not short. (See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array#Mutator_methods for more on each method.)
.copyWithin()
lets you copy elements within the array.fill()
fills...