function Func(name) {
this.name = name;
}
function Func(name) {
this.name = name;
this.sayHi = function() {
alert( "Моё имя: " + this.name );
};
}
Func.prototype.sayHi = function() {
alert( "Моё имя: " + this.name );
};
var foo = new Func('foo');
var bar = new Func('bar');
console.log(foo.sayHi === bar.sayHi);