Month: June 2017

Design Patterns in Javascript

Design Patterns in Javascript

What is a design pattern?

A design pattern in general refers to a commonly accepted general solution to a wide range of commonly occurring problems. They are the best solutions known so far for specific types of problem scenarios. When these specific types of problems occur, the best way to deal with it is the application of that specific design pattern.

Design patterns help make our task easier by facilitating proper structuring of code which helps solve all the scenarios/test cases of that particular problem. Design patterns are not restricted to any language. They are a common practice which can be applied to wide range of languages mainly the language which supports object oriented paradigm. Though JavaScript is not a completely object oriented currently(It will be from ES6 onwards), it has powerful concepts like prototype inheritance and closures which help us in implementing design patterns effectively.

Read More Read More

Difference between apply, call and bind method in javascript

Difference between apply, call and bind method in javascript

Javascript provides various ways by which we can invoke a function. Some of the functionalities javascript provides is facilitating the use of apply, call and bind to invoke a function.

All these three are used to invoke a function with a set of parameters. The difference between these types of invocation is the type of parameters supplied to the respective method.

Read More Read More