because objects.
by Joseph Tate
JavaScript
console.clear();
var animalOne = {};
animalOne.color = '';
animalOne.getColor = function () {
console.log(this.color);
};
function AnimalTwo() {
this.color = '';
this.getColor = function () {
console.log(this.color);
};
}
var firstRabbit = Object.create(animalOne);
var secondRabbit = new AnimalTwo();
console.dir(firstRabbit);
console.dir(secondRabbit);
firstRabbit.color = 'brown';
firstRabbit.tail = 'more fluffy';
firstRabbit.getColor();
secondRabbit.tail = 'fluffy';
secondRabbit.color = 'white';
secondRabbit.getColor();