Background
Stuck with typescript. I understand this declarations:
let varName:number; //null,string,..declare simple variables.
let arrName:string[] // or arrName:number[]. etc
Apparently this is used for objects:
//knowing type of the property
let obj: {property:string, also:number[]} = {property:'hello', also:[1,2,3]}
//now knowing the type of the property
let obj: {property:any, also:any[]} = {property: a && b || c, also:[1,'string', 'etc']}
But what happens when we don't know the names of the properties in advance?
Particularly, I am trying to translate this JS bit:
let myObj = {}
myObj[prop] = value
but we don't know the names of the properties in advance.
Record<string, unknown>or if you prefer to throw type safety outRecord<string, any>