My question is somewhat similar to this
I have a map with the key as objectType1 and value as objectType1 | null.
type objectType1 = { key:string , value:string }
const newMap = new Map<objectType1, Array<objectType1 | null>([
[{key:'key1', value:'value1'},null],
]);
what I want to do here is that I want a new object which looks something like:
const newObject = {
key1 : {key: 'key1', value:'value1'}
}
So basically the new object should be able to reference to the object. If i do newObject.key1, i should be able to get the object {key: 'key1', value:'value1'}
How do I go about this?