How can I create an array with keys as objects (instances of a class)?
I am trying to do something like:
const parent = {};
while (child !== undefined) {
for (const element of list) {
parent[element] = child;
}
child = child.next;
}
This is basically the idea; the code works if element is a string, but it doesn't work correctly if the element is an object.
[]notnew Array()