13/14 Problem with Not


#1


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


I recieve the Error:
Oops, try again.
It looks like your happy function returns true instead of false when programming is true.


// Declare your variables here!
var programming = false

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


#2

The only problem is this function call they never asked you to call your function. erase this line.


#3

In the base code the happy function does not take any parameters and you should not change that.

You simply have to change var happy = function(programming) { to:

var happy = function() {

@bandit Please, test your ideas before posting. Is it really so hard to open the exercise, copy code without this single line and check if it works now?

This single line does not change anything, you can call your function to test it.


#4

Okay, I will next time. Sorry for the misguided information. Thank you for pointing that out. :slight_smile:


#5

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