One module pattern for both nodejs and browser

The Module Pattern is also called “design pattern”. It helps us to keep our code clean and more readable. Lot’s of design pattern exists. But this simple pattern will make your code executable in both node and browser environment, your program must be environment independent. Means you can’t use browser api in your code if you want to use in nodejs and vice versa.
Continue reading “One module pattern for both nodejs and browser”

How to build HTML5 Mind Reader game using javascript

Have you ever played a game called The Flash Mind Reader ? It’s a simple flash game. You can play online Here or download the game by clicking Here(upnzip the folder and open the exe file).

This is what we are going to build. Mind reader game using javascript.
Continue reading “How to build HTML5 Mind Reader game using javascript”

Javascript object constructor and prototype

Every web developer knows javascript does not support classical inheritance, we use prototype of functions and objects to fill that gap. It’s called prototypal inheritance. New version of javascript has implemented classical inheritance may be a keyword “class” but actually it’s just a simulation. Under the hood it works using prototype. So it would be better to clear our concept about this confusing prototype.
Continue reading “Javascript object constructor and prototype”