title: How does the fibonacci recursive function "work"?
body: <p>I'm new to Javascript and was reading up on it, when I came to a chapter that described function recursion.  It used an example function to find the nth number of the Fibonacci sequence.  The code is as follows:</p>
  
  <pre class="lang-js prettyprint-override"><code>function fibonacci(n) {
      if (n &lt; 2){
          return 1;
      }else{
          return fibonacci(n-2) + fibonacci(n-1);
      }
  }
  
  console.log(fibonacci(7));
  //Returns 21
  </code></pre>
  
  <p>I'm having trouble grasping exactly what this function is doing.  Can someone explain what's going on here?  I'm getting stuck on the 5th line, where the function calls itself.  What's happening here?</p>