The typescript example of Prototype seems to have incorrect code

Himanshu il y a 11 mois mis à jour par Alexander Shvets il y a 10 mois 0


In the clone method of Prototype, we have the following line

clone.circularReference = { ...this.circularReference, prototype: {...this}, };

It seems to be wrong, as this is referencing a completely different temporary object. 

I think the correct code is

clone.circularReference = { ...this.circularReference, prototype: clone };

Please correct me if I am wrong. Thank you