Category Archives: Javascript

Using strict mode in javascript today

For a very long time, javascript has remained the same. Browser venders have given us new things to access from using javascript. But the language it’s self has remained pretty much the same since it’s conception in 1995. As of … Continue reading

Posted in Javascript | Tagged , | 1 Comment

OOP in Javascript, the right way

In the past months I’ve covered a lot of topics involving the basics of javascript, several design patterns, and the power of RequireJS as a tool for better JS applications. Now it’s time to put the pieces together and let’s … Continue reading

Posted in Javascript | Tagged , , , , | Leave a comment

Javascript modules

The module pattern has taken the javascript world by storm. Almost every library out there uses it these days. It has become the corner stone of server side javascript. There has even been talk of including it in a future … Continue reading

Posted in Javascript | Tagged , | Leave a comment

Variable visibility in javascript

Every function has it’s own scope. A place where we can declare variables that are only available within the function it’s self. We’ve already seen how this can create private variables in a constructor. But there is much more to … Continue reading

Posted in Javascript | Tagged , | 1 Comment

Constructors vs factories

Often in Javascript, you only want one instance of an object. In classical OOP this is done with a singleton design pattern. In javascript we simply use the object literal (i.e. { property: ‘value’}). But when we need a multitude … Continue reading

Posted in Javascript | Tagged , | Leave a comment

Inheritance using the Caller extension pattern

The caller extension pattern is a design pattern I’ve discovered, which let’s you create constructors that can inherit from any other constructor. To do this we get to use some javascript magic: the call and apply methods. So let’s see … Continue reading

Posted in Javascript | Tagged , | Leave a comment

A critical look at javascript’s prototype

Javascript’s prototype is often compared to the inheritance model used by classical OOP languages. In these languages a sub class inherits properties and methods from a super class. In the sub class you can then add and override methods and … Continue reading

Posted in Javascript | Tagged | Leave a comment

The basics of javascript prototype

In the next couple of articles I’ll introduce a number of design patterns that I feel have the potential to be the staple food of any javascript application. But to really understand these, we need to first understand some of … Continue reading

Posted in Javascript | Tagged | Leave a comment

The case for RequireJS, part 2

In the part one of this article we’ve looked at the way RequireJS helps structure an application in javascript. But there is more to it then that. RequireJS is a pretty recent tool in a landscape dominated by big players … Continue reading

Posted in Javascript | Tagged , , , | Leave a comment

The case for RequireJS, part 1

RequireJS is a javascript module created by Andy Chung James Burke. It’s a browser implementation of the commonJS asynchronous module definition. In other words, requireJS let’s you define modules, and then load them asynchronous. Because of this RequireJS allows you … Continue reading

Posted in Javascript | Tagged , , , | 3 Comments