title: Why is it these two javascript functions seem to not be getting along...what am I doing wrong?
body: <p>I'm pretty sure this is n00b question, but I'm completely new to javascript. I'm wondering why this code only prints "hello" but when I comment out the first function, that's when I get the second function to print the other two words. How does this make sense?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var function1 = createFunction();
  function createFunction()
  {
    console.log("hello");
  }
  function1(); 
  
  function createFunctionPrinter(word)
  {
    console.log(word);
  }
  
  var printSample = createFunctionPrinter('sample');
  var printNoo = createFunctionPrinter('noo');
  
  printSample(); //should console.log('sample');
  printNoo(); //should console.log('noo');</code></pre>
  </div>
  </div>
  </p>