title: Why does one check if a jquery plugin is an instance of itself before creating it? [explanation request]
body: <p>I'm looking through the following code of what I assume could be called a jquery plugin:</p>
  
  <pre><code>H5P.Summary = (function ($, Question) {
  
    function Summary(options, contentId, contentData) {
  
      if (!(this instanceof H5P.Summary)) {
        return new H5P.Summary(options, contentId);
      }
  </code></pre>
  
  <p>It seems to create a Summary object but checks if it is an instance of itself first. Could someone please explain to me why it does this and what the purpose of the return statement is?</p>
  
  <p>Source code on github:</p>
  
  <p><a href="https://github.com/h5p/h5p-summary/blob/master/js/summary.js#L3" rel="nofollow">https://github.com/h5p/h5p-summary/blob/master/js/summary.js#L3</a></p>
  
  <p>The plugin itself:</p>
  
  <p><a href="https://h5p.org/summary" rel="nofollow">https://h5p.org/summary</a></p>
  
  <p>I'm still fairly new to the web dev space, so corrections and simple explanations are welcome. </p>