has been assigned to a property name of an object. Unlike many object-oriented languages, there is no distinction between a function definition and a method definition in object-related JavaScript. Rather, the distinction occurs during function calling; a function can be called as a method. When called as a method, the standard local variable is just automatically set to the object instance to the left of the "". (There are also and methods that can set explicitly—some packages such as jQuery do unusual things with .) In the example below, Foo is being used as a constructor. There is nothing special about a constructor - it is just a plain function that initialises an object. When used with the keyword, as is the norm, is set to a newly created blank object. Note that in the example below, Foo is simply assigning values to slots, some of which are functions. Thus it can assign different functions to different instances. There is no prototyping in this example. function px() { return this.prefix + "X"; } function Foo(yz) { this.prefix = "a-"; if (yz > 0) { this.pyz = function() { return this.prefix + "Y"; }; } else { this.pyz = function() { return this.prefix + "Z"; }; } this.m1 = px; return this; } var foo1 = new Foo(1); var foo2 = new Foo(0); foo2.prefix = "b-"; console.log("foo1/2 " + foo1.pyz() + foo2.pyz()); // foo1/2 a-Y b-Z foo1.m3 = px; // Assigns the function itself, not its evaluated result, i.e. not px() var baz = {"prefix": "c-"}; baz.m4 = px; // No need for a constructor to make an object. console.log("m1/m3/m4 " + foo1.m1() + foo1.m3() + baz.m4()); // m1/m3/m4 a-X a-X c-X foo1.m2(); // Throws an exception, because foo1.m2 doesn't exist. Constructors Constructor functions simply assign values to slots of a newly created object. The values may be data or other functions. Example: Manipulating an object: function MyObject(attributeA, attributeB) { this.attributeA = attributeA; this.attributeB = attributeB; } MyObject.staticC = "blue"; // On MyObject Function, not object console.log(MyObject.staticC); // blue object = new MyObject('red', 1000); console.log(object.attributeA); // red console.log(object["attributeB"]); // 1000 console.log(object.staticC); // undefined object.attributeC = new Date(); // add a new property delete object.attributeB; // remove a property of object console.log(object.attributeB); // undefined The constructor itself is referenced in the object's prototype's constructor slot. So, function Foo() {} // Use of 'new' sets prototype slots (for example, // x = new