title: Javascript documentation: Returns null or type
body: <p>I have a function of a js class which can return a String or <code>undefined</code>. Now I want to insert the <code>return</code> statement into the function's documentation.</p>
  <pre><code>    /**
       * Test documentation.
       * 
       * @param {(String|Number)} value - A String or a number containing a number.
       * 
       * @returns {(String|undefined)} - Returns a String or undefined.
       */
      nullOrString(value) {
          // ...
      }
  </code></pre>
  <p>But when I call the function, the documentation of the <code>return</code> statement only returns <code>String</code> and not <code>(String | undefined)</code>.
  I also tried it with <code>null</code> instead of <code>undefined</code>, because <code>undefined</code> is returned by default by all functions without a <code>return</code> statement.</p>
  <p>So how can I add to my documentation that a <code>undefined</code> or <code>null</code> is returned?</p>
  <p><strong>EDIT:</strong>
  Add another test function.
  Please notice thate these examples are test functions and do not have to make sense.</p>
  <pre><code>     /**
       * Test documentation function.
       * 
       * @param {(String|Number)} input - Input String.
       * 
       * @returns {null|undefined} - Returns null when input is numeric, otherwise returns undefined.
       */
      undefinedOrNull(input) {
          if (!isNaN(parseFloat(input))) return null;
          return undefined;
      }
  </code></pre>
  <p>Visual studio code returns:</p>
  <p>undefinedOrNull(input: string | number): null</p>
  <p>Input String.</p>
  <p>Test documentation function.</p>
  <p>@returns — - Returns null when input is numeric, otherwise returns undefined.</p>