title: Extract a particular cookie from page cookies in Javascript
body: <p>I need to extract a particular cookie from page cookies in Javascript. I get them in one long string as a passed variable. String is of the format</p>
  
  <pre><code>"xyz=1; abc=2; abc-main=3" 
  </code></pre>
  
  <p>I need to extract the value of one particular cookie from this string say "abc". What is the best way to do it, is there any function that directly gives you the cookie value?</p>
  
  <p>I'm thinking of splitting this string with semicolon and then traversing the result array to find a string that starts with "abc="</p>