Skip to content

Instantly share code, notes, and snippets.

@bobdobbalina
Last active January 20, 2021 19:12
Show Gist options
  • Select an option

  • Save bobdobbalina/4d4de78d83724831ef25ee17e53ba5b0 to your computer and use it in GitHub Desktop.

Select an option

Save bobdobbalina/4d4de78d83724831ef25ee17e53ba5b0 to your computer and use it in GitHub Desktop.
Javascript: Returning randomly true or false with the same 50% of probability
var randomBoolean = Math.random() >= 0.5;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment