You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I also tried the examples and they did work for me too.
I think what the author actually meant is that when such an interface is defined:
interfaceFoo{[index: string]: number};
any members which have a string type key must have a number type value. In this case, trying to create an object member with a string type value would throw an error:
constfoo: Foo={x: 1,// Okayy: 'abc'// Error};
If this is the case, this tutorial section examples are misleading.
origin
i copied the Foo and Bar into ts playground and it works.
The text was updated successfully, but these errors were encountered: