4/6 console.log is not a function


So... i got problem with 4/6

var slaying = true;
var youHit =Math.floor(Math.random()*2);
var damageThisRound = Math.floor(Math.random()*5+1);
var totalDamage = 0;
        console.log("you hit");
    } else {
        console.log("You missed");
    slaying = false;

It seems ok. Yet it still shows

TypeError: console.log is not a function

whats wrong?

funny thing is that if i looked back at 1/6 it shows that everything is ok while in console is the same error with console.log


Your code is correct.


  1. Copy your code.
  2. Click Reset Code.
  3. Click Save & Submit Code
  4. Paste your code back into the editor
  5. Submit it again.


Lol i did it twice before and it failed every time. Now it works... strange.

Anyway thanks for help.


Glad it works now. You're welcome.


var slaying=true;
var youHit= Math.floor(Math.random() * 2)
var damageThisRound= Math.floor(Math.random() * 5 +1)
var totalDamage = 0
var loop = function() {
while(slaying) {
if (youHit) {
console.log("You hit!");
} else {
console.log("You missed!");
slaying = false;
Help! I keep getting this error:" Make sure you log a message to the console to let the player knows if (s)he won or lost!".


You are having two }}; remove one } .