Using constructor in clone method

Lincoln Karuhanga 2 years ago 0

Great stuff here, man. Looking through the prototype pattern though, got me thinking about the approach the examples took, calling constructors in the clone method. I went on a hunt for ideas, and found this https://stackoverflow.com/a/4081982/6448384.

I think it might be worth rethinking how that would play out with inheritance, without requiring inheriting classes to implement the method.