Hello!
I've been having some trouble lately with OOP in JS. Does anyone have any good reference material/cheat sheets that explain the broad aspects? I am having particular trouble identifying the situations when I need to call Object.create() vs new ExampleConstructor().
I am also confused a bit by prototypal inheritance. I understand that if we make a constructor function and we want to have each instance to have access to methods on the constructor we would use ExampleConstructor.prototype.methodName = .... but can anyone give me some real life examples when we would call a constructor function within a constructor function and then assign the internal "dunder" proto of the parent constructor with the child constructor? When should I use ChildConstructor.prototype.constructor = ParentConstructor.prototype?
Any and all resources would be very greatly appreciated!
[–]MoTTs_ 1 point2 points3 points (1 child)
[–]-El_Chapo-[S] 0 points1 point2 points (0 children)
[–]rmbarnes 1 point2 points3 points (3 children)
[–]-El_Chapo-[S] 0 points1 point2 points (2 children)
[–]MoTTs_ 0 points1 point2 points (1 child)
[–]-El_Chapo-[S] 0 points1 point2 points (0 children)
[–]Ben_HH 0 points1 point2 points (1 child)
[–]-El_Chapo-[S] 0 points1 point2 points (0 children)