As you can see in the code below, both of these "get" functions in manually-created objects have identical implementations - so why do they produce a different answer?
animal = Object.create({})
Object.assign(animal, {
_fur: 'This might not be furry',
get fur() {
return this._fur
},
fur_get: function () {
return this._fur
}
})
cat = Object.create(animal)
Object.assign(cat, {
_fur: 'This is very furry'
})
console.log(cat.fur)
console.log(cat.fur_get())
Output:
This might not be furry
This is very furry