Object Oriented JavaScript – Part 3

by Prasanth Gullapalli

As seen in the earlier article, using Constructor pattern and Prototype chaining on their own have got few problems. We resolved those problems by defining a new pattern which amalgamates both the patterns. If we look at the way we have been creating objects so far, it is very much similar to Java. In fact using new keyword sometimes makes the code more complex which we could have avoided using alternatives like Prototypal Inheritance. So the rest of article deals with how to achieve a better form of inheritance without using any new keyword. Also it addresses the issue of redundant properties(masked by the instance properties) on Prototype we have seen in Combination Inheritance. Continue reading

Object Oriented JavaScript – Part 1

by Prasanth Gullapalli

In this article I will discuss multiple ways of creating objects in JavaScript. And in the next part of this article, I will cover Inheritance in JavaScript.

In JavaScript, Objects can be created in two ways: Continue reading