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