What is wrong with this code?


#1

what is wrong with this?


#2

Try to call your function:

nap(tired, bored);

#3

I'm having the same problem

here's my code

// Declare your variables here!
var tired = true
var bored = false
var nap = function() {
// Add your if/else statement here!
if (tired == true || bored = false) {
return true
} else {
return false
}
};


#4

i did


#5

don't use console.log It just wants the return


#6

That's why my code doesn't use the console.log


#7

no, i only used it to make sure the function is returning true, and i were right. My code isnt wrong


#8

okay then why did you show us that we didn't need to know that


#9

if (tired == true || bored = false) {
   return true;
} else {
   return false;
}

You assigned bored to false. Remove it. And call function nap() at the last line.


#10

ok I'll try that thanks


#11

Remove the parameters from the nap function. I had the same problem. Leave the parenthesis empty.


#12

can you please show me the complete code? i dont get it


#13

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