title: Convert to Number from a String but only strings that are valid integers
body: <p>I have an input which is always a <em>String</em>. The string can contain an integer or text:</p>
  
  <pre><code>intputString = "1";
  </code></pre>
  
  <p>or</p>
  
  <pre><code>inputString = "hey";
  </code></pre>
  
  <p>I would like to convert to a <em>Number</em> only those inputs that contain integers. Otherwise, the inputs need to remain the same.</p>
  
  <p>For example, if I have an integer:</p>
  
  <pre><code>inputString = "288";          // &lt;-- Make the conversion 
  desiredOutput = 288;
  </code></pre>
  
  <p>And if I have non-integer text:</p>
  
  <pre><code>inputString = "hey";         // &lt;-- Don't make the conversion and leave it as is
  desiredOutput = "hey";
  </code></pre>
  
  <p>I was using <code>Numbers(inputString)</code> but this converts text values into <code>NaN</code>.</p>
  
  <p>How can I achieve this conversion?</p>
  
  <p><strong>EDIT:</strong> None of the answers from the duplicate question answers this question. </p>