I just picked up a new book on ASP.NET and AJAX and in it there is a sample like this:
Person = function(firstName) {
this._firstName = firstName;
}
Person.prototype = {
get_FirstName = function() {return this._firstName;}
}
I noticed immediately this is not what I am used to, and FireBug apparently agrees with me that its wonky. I am used to something like:
Person.protoype = {
get_FirstName: function() {return this._firstName;}
}
Is this just a typo on the author's part or is he maybe using a feature from the ASP.NET AJAX library?
Also, is there a difference between the preceding function and this:
Person.protoype.get_FirstName = function() {
return this._firstName;
}
Did the author just smush together two acceptable declarations of the same function?