title: Need help understanding JS code produced by TypeScript namespaces
body: <p>I was going through the basics of TypeScript where I came across something called <code>namespaces</code>. This is the typescript code:</p>
  <pre><code>namespace TutorialPoint { 
     export function add(x, y) { console.log(x + y);} 
  }
  </code></pre>
  <p>Now when I saw the transpiled file which contains the js version of the same code, I did not understand anything in the file.</p>
  <pre><code>var TutorialPoint;
  (
      function (TutorialPoint) {
          function add(x, y) {
              console.log(x + y);
          }
          TutorialPoint.add = add;
      }
  )
      (TutorialPoint || (TutorialPoint = {}));
  </code></pre>
  <p>I am doing Js for some 3 months now. I don't understand why <code>function(TutorialPoint)</code> is inside parenthesis. I don't understand anything after the first variable declaration except the <code>console.log</code> part. What is the meaning of the last line `(TutorialPoint || (TutorialPoint={})).</p>