Expressions as keys in Map literals
Closed this issue · 0 comments
kengorab commented
Right now, when constructing a Map literal, you can supply key-value pairs. The keys of these pairs will be stringified and will represent a type of Map<String, ..>
. The only way to have any other type as they key is to create an empty map and insert into it using indexing operators. There should be some way (syntax borrowed from javascript) to use expressions as keys:
{
a: 123,
["b"]: 456,
[someFunc()]: 789,
...
}