There are two issues here. First you want to use the lowercase string
. There is a difference (String
is the new-able constructor), but just know that you want the lowercase version for any basic type.
Second you are mixing up types and values when you do let myRecord = Record<String, Set<String>>
. You cannot set a variable to a type. You can declare the type of the variable but you also need to set the value.
let myRecord: Record<string, Set<string>> = {};
This creates a variable myRecord
whose initial value is an empty object {}
and whose type is Record<string, Set<string>>
.
Playground Link