Javascript is one of the few object oriented languages without classes.
Nevertheless it is possible to create new objects choosing among several different techniques some of which may seem confusing to the newbies.
In this article I will go through seven different ways to create objects in Javascript, pointing out the pros and cons in each of them.
Before starting, it is worth remembering that a Javascript object is a simple collection of properties. Each property is a key-value pair. The value can be a primitive type, an object, or a function. Properties can be added, updated or removed at any time.