RegExp JavaScript or Regular Expressions js

RegExp is an Object A RegExp is some object that can describe a pattern of characters. Regular expressions you can use to perform pattern-matching and “search-and-replace” functions on string. RegExp’s JavaScript syntax /pattern/modifiers; A regular expression is a sequence of characters that forms a search pattern. How to use String search() With a Regular Expression Example: You can use a regular expression to do a search for “sga” in a…

September 22, 2015
Read More >>

Singleton Pattern JavaScript

Singleton pattern js
May 13, 2015

Singleton design pattern in javascript Definition of Singleton: Ensure a class has only one instance and provide a global point of access to it. The Singleton pattern is more popular type of design patterns that restricts instantiation of a class to a single javascript object. Usually, the Singleton pattern is a class with a special method that creates a new instance of this class if one doesn’t exist in js….

Read More >>

Module Pattern JavaScript

Module pattern js
May 13, 2015

What is the Module in JS Module is an integral piece of any quality application’s architecture and can help in keeping the units of code for a your project both cleanly separated and organized. This pattern is used to mimic classes in traditional software engineering and create on public and private access to methods & variables. The module pattern was improved by the reduction of global scope variables, thus decreasing…

Read More >>

Constructor Pattern JavaScript

Constructor pattern js
May 12, 2015

The Constructor Pattern is a special method that use to initialize a newly created object once memory has been allocated for it (in classical OOP languages). But in JavaScript we will use object constructors We used object constructors to create some types of objects and preparing our objects for use and accepting arguments which a constructor will use to set the values of member propertie and method when the object…

Read More >>