title: How to cast to array in TypeScript 2?
body: <p>I had some code that cast an object to type array (so I could use array functions on the object without compile errors).</p>
  
  <pre><code>    var n = (result.data['value'] as []).map( (a)=&gt;{
        //..
      });
  </code></pre>
  
  <p>But on upgrade to ts2, I get:</p>
  
  <blockquote>
    <p>error TS1122: A tuple type element list cannot be empty.</p>
  </blockquote>
  
  <p>Which is actually a syntax error, claiming you forgot a comma or value. So, how do I modify this cast to work correctly?</p>
  
  <p>I tried <code>as [IMyType]</code> and it worked, but I'd prefer not to specify type since I only need the <code>array.prototype</code> functions here... also, I don't think that's how you actually do it. </p>