Answers for "typescript key as string"

0

typescript key as string

// This is a key/value structure. The key is a string and the value is a boolean. For example:
let map : { [key: string]: boolean} = {};
map["foo"] = true;
map["bar"] = false;
map.foo = true;
map["foobar"] = "foo"; // Throws exception
map[1] = true; // Curiously doesn't throws exception
Posted by: Guest on July-08-2021

Code answers related to "typescript key as string"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language