how to generated ramdom numbers negative or positive javascript code example Example: js random minus var plusOrMinus = Math.random() < 0.5 ? -1 : 1;