Here are two javascript snippets. i can't understand thedifferent between the two. it seems both allow newing up instances.
var Test1 = (function () {
function Test1(_x, _y) {
this.x = _x;
this.y = _y; console.log("test1");
}
return Test1;
}());
var Test2 = function () {
function Test2(_x, _y) {
this.x = _x;
this.y = _y; console.log("test2");
}
return Test2;
}();
new Test1(1,2);
new Test2(2,4);
Edit: it looks the same to me BUT, i was poking around with TypeScript and it generated the classes like Type1. there must be a reason they chose to go with that. after all the shortest code is better?
Thanks