Here is the code that i have:
type keyList = 'a' | 'b' | 'c'
type valueList = 'x' | 'y' | 'z'
I am trying to create an array of objects which such that -
const arrayOfObjects:{key:keyList, value:valueList}[] = [
{
key:'a',
value:'x'
},...
And so the keys and values are combinations of values from keyList and valueList - where all items from the keyList appear once in the array and take any value from valueList.
For some reason, my 'arrayOfObjects' object does not automatically populate all values from keyList at least once. I have about 100 keys and it is very tedious to create individual objects for that. Is there any way I can get it automatically populated?