Hello All,

I think that there is an approach error on the comparison between class-based and prototype-based.
about the sentence and probation variables....shouldn't they be static in the class-based approach to be a class variable and not instance variable.

Indeed, if in the prototype based one change the sentence value... it can be confusing...

in the class based approach, the sentence and probation variables are stored in within the instance itself... in the prototype approach they are stored in the prototype object.. except if one change their value from the instance... in that case one get two different variable overriding themself...

don't you think ?

// logs 4
console.log(firstPrisoner.sentence)

firstPrisoner.sentence = 'foo'
// logs 'foo'
console.log(firstPrisoner.sentence)

// logs 4
console.log(Prisoner.prototype.sentence)

have a nice day
birnou