There are a few use cases where an implementation of a function could be considered 'not pure' while, from the outside, it is pure.
letcomplexValue=nullexportfunctiongetComplexValue(){returncomplexValue||(complexValue=calculateComplexValue())}functioncalculateComplexValue(){// this is always the same...return...}
There are a few use cases where an implementation of a function could be considered 'not pure' while, from the outside, it is pure.