GAS is super weird: If I add a prototype to a function, the source code of the prototype is added to every instance of the function.
function createPerson() {
var me = new Person("Ben", "Jamin");
Logger.log(me);
};
function Person(firstname, lastname) {
this.firstname = firstname;
this.lastname = lastname;
};
Person.prototype.member = function() {
return "yes"
};
This is what it logs to the console:
[15-04-13 11:47:12:351 CEST] {member= function () { return "yes"; } , lastname=Jamin, firstname=Ben}
What am I doing wrong?