Section 3.5.4 of the specification states: "The array type of the ElementType [] form is equivalent to the type of the object with an index signature [index: number]: ElementType", but this does not seem to be the case, for example
var a: {[index: number]: string;}; var b: string[]; a = ['1','2']; // ERROR: Cannot convert 'string[]' to '{ [index: number]: string; }' b = ['1','2']; // OK
What am I missing here?
typescript
Stuart rackham
source share