this is my 1st question in stackoverflow.
var str="Oct 13,2011";
var date1=new Date(str);
var date2=new Date(str);
of course
valueOf(date1)==valueOf(date2)
but why
date1!=date2
or say,how to determine 2 date object if they equal each other.
Date is a js object
Javascript objects are only equal if they refer to the same object-reference. Which is not the case in your code.
(reference: What is the standard definition of object equality for "=="?)
Edit: With a little type casting you can do: