title: convert Javascript Object to a Ruby Hash
body: <p>I have a javascript object of this form</p>
  
  <pre><code> obj = "[
     {
       title: "Sean Kingston1",
       duration: parseInt("71", 10),
     },
     {
       title: "Sean Kingston2",
       duration: parseInt("71", 10),
     },
   ]"
  </code></pre>
  
  <p>is there a way to convert this to a ruby hash ?</p>
  
  <p>I tried using JSON.parse and JSON.load<br>
  both of them throw </p>
  
  <pre><code> JSON::ParserError: lexical error: invalid string in json text.
                                 {   title: "Sean Kingston1
                   (right here) ------^
  </code></pre>
  
  <p>Is there a generic solution or should I use regex and then construct the hash in ruby ?</p>