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

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -