You will need to write an effect analysis for JavaScript, which will require effect semantics for JavaScript. Some of the things to consider are:
- Does the code support primitive operations that have side effects? (e.g. writing to memory, writing to disk, IO file, updating any global state?)
- If the code is actually written to variables, do they avoid the local scope? (i.e. is in the monad ST or IO?)
- Is this any connection made using shared variables?
People have written type systems for impure languages ββto statically determine if side effects are present. Ben Lippmeier 's thesis covers a lot of space.
source share