title: How to deal with a constructor in interfaces and ensure the same access to data in different implementations?
body: <p>I am working on a project that requires a notification to be send whenever an error occurs. (I know there are tools for this but that is not relevant for didactic purposes.)</p>
  <pre><code>interface ErrorNotifier{
     NotifyInternally(): void
  }
  
  class EmailErrorNotifier{
     constructor(type, errors){
       this.type = type
       this.errors = errors
     }
     notifyInternally(){
     // send email with the type and errors etc
     }
  }
  </code></pre>
  <p>However, when I implement another instance of an <code>ErrorNotifier</code> (let's say an PhoneErrorNotifier, that sends a text message) how do I ensure that in the constructor of that class also the type and the errors are passed and are available for the <code>notifyInternally</code> method? Should I use an abstract class? Forgive me for my ignorance but I am trying to learn more OOP!</p>