How Immutability is Implemented
问题 I am trying to grasp how the trie and such in immutability is implemented, as relates to immutability in JS. I understand how there is supposed to be significant structural sharing. My question is say you have a graph sort of structure like this: a -- b | c | d -- h | e -- i -- l | f -- j -- m | g -- k -- n So then you add an x to the system. I'll try it two different ways: a -- b | c | d -- h -- x | e -- i -- l | f -- j -- m | g -- k -- n That one is just added as a leaf node. a -- b | c | d