5 Very Handy Javascript Techniques

Using with keyword to shorten your code

“with” keyword becomes extremely handy when you need to use many attributes of an object without keep calling the object

var house = {
     paint: "blue",
     size: "big",
     hasYard: true,
     numberOfLivingRooms: 2,
     numberOfStoreRooms: 1,
     numberOfBedRooms: 4,
     numberOfKitchen: 3,
     masterArea: {
           hasBedRooms: true,
           masterAreaBedRooms: 3
    }
};

(more…)

JSON Object - Powerful Javascript Notation Overview

I believe most of you have heard about using XML to store data. However, using JSON object to store data in Javascript is the most convenient way as JSON object is native in Javascript programming. An example of JSON object is as following

(more…)