title: Spliting the URL path and getting only 2 parts of it
body: <p>I need to split the path entered by the user and grab only certain part of it. For e.g. if the user enters path as:</p>
  
  <p>/content/mypath/myfolder/about/images/April/abc.jpg</p>
  
  <p>I should get it as : </p>
  
  <p>April/abc.jpg</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$(document).ready(function(){
    $('#getData').click(function(){
      imgPath = $('#imgPath').val();
  
      console.log($(imgPath).split('/'));
  
      //console.log(slicedPath);
    });
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"&gt;&lt;/script&gt;
  Image path: &lt;input type="text" id="imgPath"&gt;
  &lt;button id="getData"&gt;Click&lt;/button&gt;</code></pre>
  </div>
  </div>
  </p>