JavaScript

Objects

//The new operator pretends we have Classes

var o = new Object();
var now = new Date();


//Object literals are much faster, aka JSON

var point = {x:2.3, y:-1.2};
var rectangle =
        {
                upperLeft: {x:2,y:2},
                lowerRight: {x:4, y:0}
        };

José M. Vidal .

12 of 65