The first example simply assigns functions to a new property Testcalled method. This is nothing special or magic (by which I mean, the language does nothing interesting with it). You can call it a static method because it shares all instances, but this is really just a normal property. (Functions - objects and objects have properties.)
Test prototype , Test. . JavaScript , . prototype , , , Test, .
:
function Test() {}
Test.method = function() {};
var a = new Test();
console.log(a.method);
:
function Test() {}
Test.prototype.method = function() {};
var a = new Test();
console.log(a.method);