title: Are functions passed as parameters always callbacks? JavaScript
body: <p>If I have the code below, where I pass two functions as a parameters into the function <code>sayHi</code>, is this an example of a callback?</p>
  
  <p>I notice there are two ways of running these 'parameter functions': either as below, we I call the functions where they are defined (as arguments), or alternatively where I call the parameter in the sayHi function. Would this be the difference between a callback and an anonymous function?</p>
  
  <pre><code>function sayHi(name, testForTrue) {
      if (testForTrue == true) {
          console.log(name);
      }
  }
  
  sayHi(function() {
      return 'Zach'
  }(), function() {
      return true;
  }());
  </code></pre>
  
  <p>Another way I could get the same result, is as below. In this case I am evaluating the functions at a different time? Is there any practical difference between the two?</p>
  
  <pre><code>function sayHi(name, testForTrue) {
      if (testForTrue() == true) {
          console.log(name());
      }
  }
  
  sayHi(function() {
      return 'Zach'
  }, function() {
      return true;
  });
  </code></pre>