title: Get number from the string JS / Lodash / TypeScript
body: <p>I have a link that comes in as a string, for example:</p>
  
  <pre><code> let data = [
           '/api/customer’,
           '/api/customer/123’,
           '/api/customer/123/details’
      ];
  </code></pre>
  
  <p>I need to extract the numeric ID if there is one. The only way I found is trough _.isNaN():</p>
  
  <pre><code>const myStrArray = type.split('/');
  const numericsArray = _.filter(myStrArray, urlPart =&gt; !_.isNaN(parseInt(urlPart, 10)));
  const id = numericsArray[0]; // undefined/123
  </code></pre>
  
  <p>Is there a better way to do this?</p>