`(Math.random() * 0.5) ? -1 : 1` almost always yields `-1`. Is that what you want? Shouldn't it be `((Math.random() * 2) | 0) * 2 - 1`? That case, this is equivalent to `Math.floor(Math.random() * (2e5 - 1) - 1e5 + 1)` ranging from -99999 to 99999.