title: Is there a built-in javascript function similar to os.path.join?
body: <p>Is there a built-in javascript (client-side) function that functions similarly to Node's <code>path.join</code>? I know I can join strings in the following manner:</p>
  <pre><code>['a', 'b'].join('/')
  </code></pre>
  <p>The problem is that if the strings already contain a leading/trailing &quot;/&quot;, then they will not be joined correctly, e.g.:</p>
  <pre><code>['a/','b'].join('/')
  </code></pre>