Objects

// Using an object literal var objectA = { a: 42 }; // Using an object function var objectB = new Object(); objectB.a = 42; // Using a construct function var constructor = new function (a) { this.a = a; }; var objectC = new constructor(42);
Back to presentation