typescript - Why length should be subtype of the indexer? -


i see example in typescript handbook @ here. don't understand why length property not valid?

interface dictionary {   [index: string]: string;   length: number;    // error, type of 'length' not subtype of indexer }  

because x['length'] number, said indexing x string produces string. can't both true.


Comments

Popular posts from this blog

jquery - How do you format the date used in the popover widget title of FullCalendar? -

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -