I'm struggling with a unique tree
data structure in my code. Each node is represented by an object
, and I need to transfer the entire tree to the front-end. Unfortunately, JavaScript's limitation on using objects as keys prevents me from implementing the following solution:
tree = {{}:{{}:{}, {}:{}, ...}, ...}
Is there an alternative method I can use to achieve this task? And how should I go about parsing the tree back in the front-end?