title: Reusing a function returning a inner function
body: <p>How can I make f ("Michael") return a string "Michael"?</p>
  
  <p>I need f() to yield "Michael" and f ("Michael")("Jackson") to yield Michael Jackson</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>    function f (firstName) {
          var nameIntro = "This celebrity is ";
          
         function lastName (theLastName) {
              return nameIntro + firstName + " " + theLastName;
          }
          return lastName;
      }
      
      
      
      console.log(f ("Michael")("Jackson"))
  
  I'm really after a solution for this..
  The above original question was not precise enough..
  f()='f'
  f('it' ) == 'fit'
  f()('x') == 'fox'
  f()()('bar') == 'foobar'</code></pre>
  </div>
  </div>
  </p>