If you enjoy JavaScript and are interested in how things work without syntactic sugar behind the scene, you are in right place!

new operator in Javascript lets developers instantiate user-defined objects.

To understand how and what are the steps of instantiating an object in JavaScript we will make our implementation of new operator.

Because new keyword is a reserved word in javascript we can not use it so we will have to implement a createInstance() function which will return instantiated object.

1. Create empty object

This one is quite straightforward.

Inside our createInstance()function we simply create an empty object called newInstance, which later became…

Jozef Bíroš

Web developer. Interested in modern JavaScript technologies and a big fan of great UI/UX design.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store