javascript6_examples icon indicating copy to clipboard operation
javascript6_examples copied to clipboard

shouldn't the constructor be passed instead?

Open maesitos opened this issue 9 years ago • 0 comments

@davidflanagan in examples/09.12.SingletonSet.js line: 11, shouldn't SingletonSet be passed to extend instead of SingletonSet.prototype ?

Additionally if extend is defined like this: Function.prototype.extend = function(){} shouldn't it be used with Set.extend instead of Set.prototype ?

So, from this:

// Now add properties to the prototype.
// These properties override the properties of the same name fro
Set.prototype.extend(SingletonSet.prototype, {...

To this

// Now add properties to the prototype.
// These properties override the properties of the same name fro
Set.extend(SingletonSet.prototype, {...

I don't know if it's an error or it's something I don't get from the chapter. This has been driving me nuts for a couple of days! Thanks.

maesitos avatar Oct 13 '16 17:10 maesitos