Object.create history and memory leaks

added by Robert Greyling
1/15/2015 2:50:40 PM


There are at least a few ways to create an object in JavaScript based on a given prototype object. One of them is the Object.create function that was a part of the ECMAScript 5 release. However, before ECMAScript 5 was introduced this function had had to be implemented by programmers themselves and it actually has existed in our programs in a few versions. That said, it’s worth digging into the history of Object.create to see how we used to make objects based on a prototype object. It can lead us to very interesting observations, particularly on how memory leaks can occur in our code and why optimization can be evil.