// contructor function
function Guitar(type, color, amount) {
 // private variable, undefined outside the class
 var imPrivate = 800;
this.type = type;
 this.color = color;
 this.amount = amount;
 this.buy = function (number) {
 this.amount += number;
 };
 this.sell = function (number) {
 this.amount -= nubmer;
 };
 this.printInfo = function() {
 return this.type + ' ' + this.color + ' ' + this.amount + ' ' + this.hasStrings;
 };
}
// Now, prototypes: static variables/functions that
// remain the same value for all of them
// This way you define every one separetly, each per line
/*
Guitar.prototype.hasStrings = true;
Guitar.prototype.players = 6;
Guitar.prototype.hirePlayers = function(number) {
 this.players += number;
}
Guitar.prototype.firePlayers = function(number) {
 this.players -= number;
} 
*/
// While here you define them together + getters and setters
Guitar.prototype = {
 set setPlayers(players) { this.players = players || 0; },
 get getPlayers() { return this.players; },
 hasStrings : true,
 players : 6,
 hirePlayers : function(number) {
 this.players += number;
 },
 firePlayers : function(number) {
 this.players -= number;
 }
}
var myGuitar = new Guitar('Spanish', 'Black', 1);
var yourGuitar = new Guitar('Electric', 'Red', 2);
var ourGuitar = undefined;
console.log(myGuitar.printInfo());
myGuitar.buy(6);
console.log(myGuitar.printInfo());
console.log(yourGuitar.printInfo());
console.log(myGuitar.players);
myGuitar.firePlayers(2);
console.log(myGuitar.players);
console.log(myGuitar instanceof Guitar);
console.log(ourGuitar instanceof Guitar);
console.log(myGuitar.hasOwnProperty('type'));
console.log(myGuitar.hasOwnProperty('players'));
// print getters and setters
myGuitar.setPlayers = 24; // notice here you did't use the parenthesis ()
console.log(myGuitar.getPlayers);