+ 2
Why does "var MATH = Math.floor(Math.random(33)); document.write(MATH)" write 0?
CODE: var MATH = Math.floor(Math.random(33)); document.write(MATH) WHY: I wanted to test it out
1 Answer
+ 4
Math.random() does not accept any parameters since "random()" is only a method to the "Math" object and not a function.
instead, use "var MATH = (Math.random()*33).toFixed(0)" to generate a random integer value from "0 - 32" inclusively.