How to: Understanding the difference between Object.create() and new SomeFunction() in JavaScript
How to: Understanding the difference between Object.create() and new SomeFunction() in JavaScript
Understanding the difference between Object.create() and new SomeFunction() in JavaScript
I recently stumbled upon the Object.create() method in JavaScript, and am trying to deduce how it is different from creating a new instance of an object with ‘new SomeFunction()’, and when you would want to use one over the other.
Consider the following example:
var test = {val: 1, func: function(){ return…
View On WordPress













