title: Getting All Values from Comma Separated String in Javascript
body: <p>I have 1 String Variable in JavaScript which contains 3 Comma separated values shown below:</p>
  
  <pre><code>var session = "mick@yahoo.com,123456,f_id=8";
  </code></pre>
  
  <p>I want to get all above 3 comma separated values in 3 different variables. What I have achieved so far is getting last comma separated value in elem2 variable and getting other 2 comma separated values 1st and 2nd one in elem1 variable.</p>
  
  <pre><code>var elem1 = session.split(",");
  
  var elem2 = elem1.pop();
  
  document.write("elem1 = "+elem1+"&lt;br/&gt;elem2 = "+elem2);
  </code></pre>
  
  <p>So my program is not working fine as I wants, please I need quick working solution so that I have another variable elem3 and I will get following output in my browser:</p>
  
  <pre><code>elem1 = mick@yahoo.com
  elem2 = 123456
  elem3 = f_id=8 
  </code></pre>