find the day according to the date in javascipt
<p>The only thing new here is the use of <code>eval()</code>:</p>

<pre><code>myDate=new Date(eval('"'+aText.value+'"'))
</code></pre>

<p>We need the date with quotes around it, but, as it appears in the box, it does not have any. So we add the quotes. But this makes a mere string, and we want a <code>Date</code> object. So we use <code>eval()</code> to make the changes.</p>

<p>It's not giving the right answer</p>

<pre><code>function getTheDay(aText)
{

    myDays = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
    console.log(eval('"' + aText.value + '"'));
    myDate = new Date(eval('"' + aText.value + '"'))
    console.log(myDate)
    document.write(myDays[myDate.getDay()], "day");

}
</code></pre>
