Skip to content

Instantly share code, notes, and snippets.

@clemherreman
Forked from robink/random_sign.js
Created November 10, 2011 13:43
Show Gist options
  • Save clemherreman/1354874 to your computer and use it in GitHub Desktop.
Save clemherreman/1354874 to your computer and use it in GitHub Desktop.
-1 | 1
var randomSign = function() {
return (Math.random() > 0.5) ? 1 : -1;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment