JavaScript Object Orientation

JavaScript: Object Orientation

By: Stephen Patrick | 20 Jul 2016 | Category: JavaScript Object Orientation

JavaScript: Object Orientation

JavaScript supports object orientated features. JavaScript is not a traditional object orientated language as it is a prototypical language. A prototypical language does not make a distinction between classes and objects as is with programming languages such as Java and C#. An object in JavaScript has a prototype property.

Read More

JavaScript: Object Literals

By: Stephen Patrick | 21 Jul 2016 | Category: JavaScript Object Orientation

JavaScript: Object Literals

JavaScript also allows us to create objects via object literal notation. This notation does not use a constructor function. Moreover, defining a variable with object literal notation does not require the use of the new keyword. As previously mentioned when we create an object using a constructor function we use the new keyword. The new keywords creates a new reference type.

Read More

JavaScript: Object Properties

By: Stephen Patrick | 27 Jul 2016 | Category: JavaScript Object Orientation

JavaScript: Object Properties

We can add properties to objects. Properties, allow us to give a name to a value we wish to store on the object. We can add both data and behavior to our objects. Properties can also be added to an object at run-time.

Read More

Javascript Accessor Properties

By: Stephen Patrick | 28 Jul 2016 | Category: JavaScript Object Orientation

Javascript Accessor Properties

As mentioned, we can add properties to an object as an own property added to the object itself, or to the object prototype. JavaScript provides us with another type of property called an accessor property. This property can be likened to a property in c# .net.

Read More