take a random number between 1 and 4 javascript code example
Example: javascript random number 1 or -1
//an equation that returns either 1 or -1
var number = ((Math.floor(Math.random() * 2) - 2) * 2) + 1
//an equation that returns either 1 or -1
var number = ((Math.floor(Math.random() * 2) - 2) * 2) + 1