Skip to content

Instantly share code, notes, and snippets.

@nealalan
Created August 5, 2019 23:29
Show Gist options
  • Select an option

  • Save nealalan/f361cf38ec6f515452c2070b30e8100c to your computer and use it in GitHub Desktop.

Select an option

Save nealalan/f361cf38ec6f515452c2070b30e8100c to your computer and use it in GitHub Desktop.

Revisions

  1. nealalan created this gist Aug 5, 2019.
    13 changes: 13 additions & 0 deletions jsmath.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    ### 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)
    ```js
    console.log(Math.floor(Math.random() * 10));
    // → 2
    // Result will be between 0 and 9
    ```