initialization - Declare and initialize a Dictionary in Typescript
https://stackoverflow.com/questions/15877362/declare-and-initialize-a-dictionary-in-typescript
WEBApr 8, 2013 · You can make use of the typed dictionary by splitting your example up in declaration and initialization, like: var persons: { [id: string] : IPerson; } = {}; persons["p1"] = { firstName: "F1", lastName: "L1" }; persons["p2"] = { firstName: "F2" }; // will result in an error. edited Mar 14, 2016 at 8:05.
DA: 31 PA: 79 MOZ Rank: 13