How do I put a javascript variable inside javascript array?
<p>I'm sure this is a simple question, but I couldn't find the answer.</p>

<p>I've included the code as well as my explanation.</p>

<pre><code>var dates = "'2012-07-22','2012-07-26','2012-07-28'";
</code></pre>

<p>i have this JavaScript variable and i need to pass it the below <code>filterDates</code> array...something like this </p>

<pre><code>filterDates = [dates]; 
</code></pre>

<p>or </p>

<pre><code>filterDates = [document.write(dates)];

var filterDates = [];
</code></pre>

<p>I really don't know how to do it with JavaScript...for example we can do it in php like this</p>

<pre><code>filterDates = [&lt;?php echo $thatVariable; ?&gt;];
</code></pre>

<p>How do I do this in JavaScript?</p>
