How to get each value from a comma separated string in JavaScript?
<p>Lets consider I have a string called </p>

<pre><code>string s = "jpeg, jpg, gif, png";
</code></pre>

<p>So from this I need to get each one like, I can assign each extension to one var variable
such as </p>

<pre><code>var a = jpeg
var b = jpg
var c = gif
var d = png
</code></pre>

<p>Same way if I will add more extensions to the string then accordingly I will have to get all with same var variable.</p>
