function Fruits() {
this.Banana = function() {
this.getColor = function(){
return 'yellow';
};
};
this.Apple= function() {
this.getColor = function(){
return 'red';
};
};
}
var apple = new Fruits.Apple();
console.log(apple.getColor());
This doesnt work. What did i miss here? Is this the wrong approach on a "class" with nested methods?
Thanks