1. if / else


#1

The following code works. The only part I don't understand is why we include function(number). What is function(number) ? What does it do exactly?

var isEven = function(number) {
  if(number%2===0) {
  return true;
    }else{return false;}
 
};


#2

The following:

function(parameter){
    // lots of code
}

is the syntax to create an anonymous (nameless) function. By doing the following:

function(number) {
    if(number%2===0) {
        return true;
    }else{
        return false;
    } 
}

you are creating an anonymous function with one parameter (`number`). Then you are assigning this anonymous function to the variable `isEven`:

var isEven = function(number) {
  if(number%2===0) {
  return true;
    }else{return false;}
 
};