title: Cut beggining and end of string in JS
body: <p>I have a string like this:</p>
  
  <pre><code>test_b0e0bef67-6f0bc-4efb2c-9fee58-a1ffe.pdf
  </code></pre>
  
  <p>How can I  cut string into pieces and form an array like so: </p>
  
  <pre><code>['test', 'b0e0bef67-6f0bc-4efb2c-9fee58-a1ffe', 'pdf']
  </code></pre>
  
  <p>This is one possible solution but I believe this is not the most elegant.</p>
  
  <pre><code>const firstPart = string2.split('_');
  const secondPart = first[1].split('.');
  const result = firstPart.concat(secondPart);
  </code></pre>