Skip to content

Instantly share code, notes, and snippets.

@nealalan
Created August 5, 2019 23:29
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 nealalan/f361cf38ec6f515452c2070b30e8100c to your computer and use it in GitHub Desktop.
Save nealalan/f361cf38ec6f515452c2070b30e8100c to your computer and use it in GitHub Desktop.
JavaScript Match Function

MATH FUNCTION

  • Math.max (maximum)
  • Math.min (minimum)
  • Math.sqrt (square root)
  • Math.PI
  • Math.random (decimal)
  • Math.floor (rounds down to the nearest whole number)
console.log(Math.floor(Math.random() * 10));
// → 2
// Result will be between 0 and 9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment