Consider the following:
Are the following code piece equivalient ?
var foo = Class.create();
foo.prototype = {
initialize : function() {};
sayHello : function() {};
}
and
var foo = Class.create();
foo.prototype = {
initialize : function() {};
}
foo.prototype.sayHello : function() {};
Secondly, which one to prefer other the other ? when and why
?