November 5th in Functional Programming by . no comment .

Everything You Need To Know About JavaScript Functions (and more)

Functions are the building blocks of any JavaScript module. In this tutorial, we’ll have a glance on basic principles behind functional programming in JavaScript, along with some lesser known features of JavaScript functions. This is mainly a follow-up, and a more in-depth analysis, of a former JavaScript Function Kung-Fu post. …

Continue Reading
October 16th in Isolated Objects by . 1 comment .

A Little Known Encapsulation Technique in JavaScript: Isolated Objects

There’s not a single post in the blog that I’ve not mentioned or used the module pattern. The module pattern is really useful in encapsulating functions, objects, and static configuration constants; making them invisible and inaccessible outside the module‘s boundaries. Here’s a simple example, which we have elaborated in depth …

Continue Reading
April 26th in Basics, Tutorial by . no comment .

Functions and Closures in JavaScript

How to Declare a Function There are various ways to declare a JavaScript function: You can either declare with a function statement or with an anonymous function expression or by using a named function. //declare a function function sample(){} //a function expression var functionExpression = function(){}; //a named function var …

Continue Reading
April 24th in Module, Patterns and Practices, Tutorial by . 4 comments .

The JavaScript Module Pattern

Introduction Module Pattern is excellent for encapsulating component-specific knowledge. It was first coined by Eric Miraglia, years ago at Yahoo! User Interface Blog. Especially when developing external widgets to sites, this pattern is a good candidate, because your widget’s logic will be encapsulated inside a closure, and it will not …

Continue Reading
o2.js _
Fork Ribbon