Sitemap
Timothy Fenney

Timothy Fenney

Jan 10, 2023

Nice article! It was a joy to read, both for the technical knowledge, and the quality of the writing as well.

I wanted to add another thought to the conversation. The use of JSON.stringify, depending perhaps on the JS engine, can produce two different string keys for 2 objects which had keys inserted in differing orders.

In this case, it may be worth it to come up with a canonical ordering. For example, one could retrieve the entries, sort them lexicographically by key, then reduce them to a new object for consumption by JSON.stringify.

In addition, if we have subclasses of Object, we may wish to cache instances with the same keys and values separately. That way we have captured what the argument _is_, and what are its _contents_.

Once again thanks for the article and good work.

--