FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Bring bouncing balls JS in line with tutorial text · jackcoolpython/learning-area@e526e07 · GitHub

Repository navigation

Commit e526e07

Browse files
authored
Bring bouncing balls JS in line with tutorial text
On https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/Object_building_practice, the random function generates a number in [min, max], whereas in the provided main.js file it is [min, max).
1 parent 82eafa9 commit e526e07

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • javascript/oojs/bouncing-balls

‎javascript/oojs/bouncing-balls/main.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const height = canvas.height = window.innerHeight;
88

99
// function to generate random number
1010

11-
function random(min,max) {
12-
const num = Math.floor(Math.random()*(max-min)) + min;
11+
function random(min, max) {
12+
const num = Math.floor(Math.random() * (max - min + 1)) + min;
1313
return num;
1414
}

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL