title: open-ended function arguments with TypeScript
body: <p>IMO, one of the main concerns of the <a href="http://www.typescriptlang.com">TypeScript</a> language is to support the existing vanilla JavaScript code. This is the impression I had at first glance. Take a look at the following JavaScript function which is perfectly valid:</p>
  
  <blockquote>
    <p>Note: I am not saying that I like this approach. I am just saying this is a
    valid JavaScript code.</p>
  </blockquote>
  
  <pre><code>function sum(numbers) { 
  
      var agregatedNumber = 0; 
      for(var i = 0; i &lt; arguments.length; i++) { 
          agregatedNumber += arguments[i];
      }
  
      return agregatedNumber;
  }
  </code></pre>
  
  <p>So, we consume this function with any number of arguments:</p>
  
  <pre><code>console.log(sum(1, 5, 10, 15, 20));
  </code></pre>
  
  <p>However, when I try this out with <a href="http://www.typescriptlang.org/Playground/">TypeScript Playground</a>, it gives compile time errors.</p>
  
  <p>I am assuming that this is a bug. Let's assume that we don't have the compatibility issues. Then, is there any way to write this type of functions with open-ended arguments? Such as <code>params</code> feature in C#?</p>