Gerrit Linnemann 0dd4236e11 Initial Commit
2017-12-18 14:24:11 +01:00

30 lines
505 B
JavaScript

/* JavaScript Object Boilerplate *
* @version 1.0
* @author - Gerrit Linnemann
*/
// Constructor
function Animal(input) {
// always initialize all instance properties
if(typeof input === 'object') {
this.name = input.name;
this.age = input.age;
} else {
this.name = input;
this.age = -1; // default value
}
}
// public methods
Animal.prototype.fooBar = function() {
};
// private function
var myFunction = function() {
}
// export the class
module.exports = Animal;