TypeScript Version: 2.1.1 / nightly (2.2.0-dev.201xxxxx)
Code
// A *self-contained* demonstration of the problem follows...
interface test{
[index: number]:number;
length: number;
}
let abc:test;
abc[1] = 213;
console.log(abc[1]);
error tip
abc[1] = 213;
TypeError:Cannot set property '1' of undefined
Expected behavior:
Actual behavior:
Typescript does not initialize the interface for you.
So after let abc: test; the variable is still undefined.
Try let abc: test = {length: 0};
TypeScript should even tell you that you're using abc before you've assigned it.

Thank those who helped me
Most helpful comment
TypeScript should even tell you that you're using
abcbefore you've assigned it.