Understanding Constructor Functions in JavaScript for Object Creation
Constructor Execution Steps
When a constructor function is invoked with the new keyword, the following steps occur:
A new empty object is created in memory.
The [[Prototype]] of that new object is linked to the constructor's prototype property.
The this binding inside the constructor is set to the newly created object.
The constructor's code e ...
Posted on Mon, 20 Jul 2026 17:18:30 +0000 by thompsonsco
Implementing Factory Method Pattern in C++
Limitations of Simple Factory Pattern
The Simple Factory pattern successfully separates object creation from business logic, but it violates the Open-Closed Principle. This principle states that software entities should be open for extension but closed for modification.
Consider a scenario where you need to add a new monster type called Beast. ...
Posted on Fri, 26 Jun 2026 16:54:42 +0000 by mightymaster
Custom Objects in JavaScript
JavaScript allows developers to define custom objects beyond built - in methods and classes. There are three primary syntaxes for creating custom objects:
1. Using the Built - in Object Constructor
To create an object with the system - provided Object constructor, you can do the following:
// Instantiate an object
let user = new Object();
// Ad ...
Posted on Fri, 05 Jun 2026 16:21:26 +0000 by Archer36