Puzzles about CONS of using constructor functions

Hi guys, im currently reading MDN Docs for learning js prototype chains.
But I can’t understand what it says about the CONS of using constructor functions as follows:(link)

  • In order to use this method, the function in question must be initialized. During this initialization, the constructor may store unique information that must be generated per-object. This unique information would only be generated once, potentially leading to problems.
  • The initialization of the constructor may put unwanted methods onto the object.
  1. What does it mean by ‘initialize the function in question’? I can’t get it. (how to initialize a function i mean)
  2. What exactly the ‘unique information’ is? Why would it lead to problems?
  3. Why this ‘unique information’ will only be generated once?
  4. How come there’s unwanted methods put on targets?

It seems like I totally missed the point and can’t understand the cons. Really appreciate it if someone can explain it to me. Thx a lot!

anybody help? :sob:Still cant find a detailed explanation

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.