Syntax


#1

var slaying = true;
var youHit = Math.floor(Math.random()*);
var damageThisRound = Math.floor(Math.random()*5+1);
var totalDamage = 0;
while( slaying ){
console.log("You're Slaying");
slaying=false
}

I don't know what is mistake in this code..but it is showing..

SyntaxError: expected expression, got ')'


#2

HI this line

var youHit = Math.floor(Math.random()*);

try to remove the * after Math.random()


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.