Question: I have a little question. I want to write a function in javascript and the function needs to take two extra parameters, for when the function is true and false. But I don't know how to write it. So, I want something like this:

```
function greater (para1, para2, casetrue, casefalse) {
    if (para1 > para2) {
       casetrue
    }
    else {
         casefalse
    }
}

```

Is this possible? Because I wrote that function and than I called the function with 
`greater(5,3, function() { return "is greater" }, function() { return "is smaller" })` and it didn't work.

Can anybody please help? 
Thanks in advance

Answer: 
try this way, otherwise you'll be returning a function:

```
function greater (para1,para2,casetrue,casefalse) {
  if (para1 > para2) {
    return casetrue();
  } else {
    return casefalse();
  }
}

```
Like has been suggested in other answers, the `greater` function is returning functions instead of strings. If this is the desired behavior, you can call the returned function with an extra pair of brackets:

```
greater(5,3, function() {return "is greater"},function() {return "is smaller"})()

```