Creating New Objects in JavaScript
- by Ken Ray
I'm a relatively newbie to object oriented programming in JavaScript, and I'm unsure of the "best" way to define and use objects in JavaScript. I've seen the "canonical" way to define objects and instantiate a new instance, as shown below.
function myObjectType(property1, propterty2) {
this.property1 = property1,
this.property2 =…