javascript random number from negative to positive code example Example: math random from minus 1 var plusOrMinus = Math.random() < 0.5 ? -1 : 1;