math random javascript stack overflow