13. Not


#1


https://www.codecademy.com/courses/javascript-beginner-en-qDwp0/2/4?curriculum_id=506324b3a7dffd00020bf661


SyntaxError: Unexpected token }


var programming = false// Declare your variables here!


var happy = function() {
  if (
};


#2

You haven't finished your if (...) statement...?


#4

I don't understand the instructions for the if statement


#5

if statements;

if (this is true) {
 //this will be run
}
else if (this is true) {
  //this will be run
}
else {
    //this will be run
}

#6

i don't understand??


#7

the basic if statement is written like this

if(This is true) {
//do this
} else {
// do this other thing
}

if that doesn't help then I would suggest going back and reading about the if statement


#8
  1. Create a variable called programming
  2. Create a function called happy() with no parameters,
  3. Inside the function's {}, create an if/else statement, where you return true if programming is false, and false otherwise.

Here's part of it, figure the rest out yourself:

if () {
  return true;
}
else {
  return false;
}

#9

I'm stuck on the same part

// Declare your variables here!
var programming = false

var happy = function() {
  // Add your if/else statement here!
if (programming === false) {
    return !false
} else {
    return !true
};

like the Not statement part so here is my code


#10

I'm also trying to help with the if statement


#11

@minecraftmaster02
@jibblyj
i still am stumped


#12

write the if statement like how it was in the part before the dragon slayer


#13

i cant find it :angry: :angry:


#14

Your if statement should returns true when programming equals to false. Why did you use so difficult logic? Just do what instruction says:

happy returns true if programming is false and false otherwise

And did you call function happy()?


#15

You're returning the wrong things. Remember, putting an exclamation point ! infront of something means "not -", so !true is false etc.


#16

I past it. and Code your own adventure 2! :relaxed: :relaxed:


#17

I don't think I remember how?


#18

To call function just type:

happy();

#19

here's my code

// Declare your variables here!
var programming = !false

var happy = function() {
// Add your if/else statement here!
if (programming == false) {
return false
} else {
return true
};
happy(programming == !false ||!true);

and here's what is being logged

SyntaxError: Unexpected end of input


#21
  1. You didn't close your function happy().
  2. Function happy() doesn't have any parameters, so you need to call this fuction without any arguments:

happy();

#22

happy();
just sayin'
Never mind. You got it.