title: Creating a new Location object in javascript
body: <p>Is it possible to create a new Location object in javascript? I have a url as a string and I would like to leverage what javascript already provides to gain access to the different parts of it.</p>
  
  <p>Here's an example of what I'm talking about (I know this doesn't work):</p>
  
  <pre><code>var url = new window.location("http://www.example.com/some/path?name=value#anchor");
  var protocol = url.protocol;
  var hash = url.hash;
  // etc etc
  </code></pre>
  
  <p>Is anything like this possible or would I essentially have to create this object myself?</p>