title: JavaScript: Why isn't this callback function not working?
body: <p>It says: TypeError: myFunc is not a function</p>
  
  <p>I want the output to be  "I am happy, haha!".</p>
  
  <p>I'm learning callback functions in JS.</p>
  
  <pre><code>function emotions(myString, myFunc) {
      console.log("I am " + myString + ", " + myFunc(2));
  }
  var laugh = function(val) {
      var ha="";
      for(var i=0;i&lt;val; i++) {
          ha=ha+"ha";
      }
      return ha;
  };
  
  emotions("happy",laugh(2));
  </code></pre>