Reference error: math not defined [solved]


#1

I keep getting an error where it says i haven't defined the variable totalDamage to 0. Even though my code has defined it. here is my code

var slaying = true;
var youHit = math.floor(math.random()*2);
var damageThisRound = math.floor(math.random()*5+1);
var totalDamage = 0;

is this a bug?


#2

Hey @yusrighouse! Its not a bug. Notice all your math are lower case. Its suppose to be uppercase like this:

Math.floor(something)
Math.random(something)

#3

Oooooooh. Okay fixed my prob. Thanks.