js random minus

JavaScript
var plusOrMinus = Math.random() < 0.5 ? -1 : 1;
Source

Also in JavaScript: