title: Adding trailing slash to URL with JavaScript
body: <p>i have a input field that is accepting url from user and i need to check for trailing slash like so:</p>
  
  <ul>
  <li>www.example.com (add slash)</li>
  <li>www.exaple.com/ (ignore)</li>
  <li>www.example.com/index.php (ignore)</li>
  </ul>
  
  <p>How could i achieve this in javaScript?</p>
  
  <p>PS .htaccess and php are not the options</p>