That's what I was thinking. I wonder what the memory and download footprint for that would be in practice. Considering characters are represented by string objects in JavaScript, it could get expensive, unless the runtime interns short strings. If not, you could represent single letters with integers, which are almost certainly interned or even use a non-pointer representation. All those objects at each tree level might be a bit much though.