Skip to content

Instantly share code, notes, and snippets.

@kieranbarker
Last active February 1, 2021 10:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kieranbarker/25b1b4b4cef14c65b10dcefdc462f6ee to your computer and use it in GitHub Desktop.
Save kieranbarker/25b1b4b4cef14c65b10dcefdc462f6ee to your computer and use it in GitHub Desktop.
Get a random truthy/falsy value
/**
* Get a random truthy/falsy value
* {@link https://gist.github.com/kieranbarker/25b1b4b4cef14c65b10dcefdc462f6ee}
* @returns {Number} 1 (truthy) or 0 (falsy)
*/
function fiftyFifty () {
return Math.round(Math.random());
}
@kieranbarker
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment