null + null = 0, +new Date, and why loosely typed languages like Javascript are a pain

Javascript is a loosely typed language. This was done to expedite the writing of code and avoiding tedious tasks such as declaring variables and explicitly defining their types. You know, the kind of stuff only suckers would do…. Read More

Scoping of “this” – client side Javascript versus server side NodeJS

Every function in Javascript has a “this” object that behaves differently depending on the execution context. Everytime a function is executed in Javascript, there is an object context associated with it; “this” provides a way to reference that… Read More

Exploring Javascript closures

Javascript closures are a concept that is easier to explain by example: function outer(increment) { var outer_foo = 1; function inner() { outer_foo += increment; return outer_foo; } return inner; } var outer_instance = outer(2); var foo1 =… Read More

json-schema how to reference other schemas in jsonschema2pojo

I’ve been using the jsonschema2pojo utility at work to automatically generate java classes from JSON schemas, simplifying a lot of the tedious code that needs to be written for the marshalling and unmarshalling of JSON objects. JSON schema… Read More

Does Javascript pass by value or pass by reference?

Javascript exhibits quite interesting behavior when it passes object parameters. At first glance, it would appear that it passes everything by reference. Consider the following HTML page. <html> <body> <script type=”text/javascript”> function MyObject() { this.value = 5; }… Read More

CIW Javascript Specialist Certification

Last year I got my MCTS EXAM 70-433: Microsoft SQL Server 2008 Database Development certification and wrote about my experience.    To recap, while I doubt that there is much intrinsic value in the certificate itself, the extrinsic value… Read More

Professional Javascript for Web Developers

Professional Javascript for Web Developers is a comprehensive 800+ page tome that does a deep dive on all things Javascript.     It starts off with a brief history of the ECMAScript standard that Javascript is derived from, before launching… Read More

Javascript arguments.callee

All functions in Javascript are instances of the Function type, meaning that they are actually objects. And just like any other object in Javascript, they can have their own set of properties and methods. One such property is… Read More

Using closures to simulate encapsulation in Javascript

Javascript is not an object oriented programming language per se. Although everything in Javascript is an object, there is no real concept of a class construct; objects are simply a collection of key/value pairs. As a result, tenets… Read More

Javascript === operator

Like most scripting languages, Javascript is not strongly typed. This causes implicit typing to occur when two variables are compared, resulting in some interesting behaviors. A prime example of this is the equality operator ==. For example, if… Read More