I have a dictionary like the one below
let dict = {
a:{
first:1,
second:2
},
b:{
first:2,
second:3
}
}
I want to loop through the first set of keys and then manipulate the second set of keys. something like the below code:
for(const firstKey of dict){
firstKey.first = 5
}
The problem is that compiler is giving me an error on firstKey.first = 5saying
Property 'first' does not exist on type 'string'.
Why is this happening? I also tried firstKey[first] which did not work either.