I think it's commonly agreed that pure functions depend only on their inputs AND cannot have side effects. So when introducing 'Math.random' the function would be impure as it has side effects.
If however Math.random is passively listening for background radiation through some sensor perhaps then it doesn't really have side affects does it? Nor does it have mutable state, for that matter.
But it would still be impure according the true definition of what is a pure function, I believe.
((j) => () => j++)(0)