So in javaScript the Object.create method or _.create in lodash might come up now and then in many code examples. These teo methods are ways of creating a new object with a given object that will function as the new objects prototype object. The prototype object is something that is separate from what is often called the own properties of the object, and with that said both of these methods also provide a way to create open properties for the new object also. However there are some very important differences between the two methods, the lodah create method works the way that I would want such a method to work in most cases. However the native method allows for a greater degree of flexibility when it comes to defining own properties of the object including the ability to make some of the own properties not enumerable for example.
If you are still new to javaScript the prototype is something that you should become familial with at some point sooner or later, as it is a major part of javaScript development. In this post I will be giving some use case examples, and hopefully give at least a basic idea of what the create object method is all about.
Read More