Here is the code:
var collection = [new Date(2014, 11, 25), new Date(2014, 11, 24)]; var d=new Date(2014, 11, 24); var idx= collection.indexOf(d);
Array.prototype.indexOfDate = function(date){ for (var i = 0; i < this.length; i++){ if (+this[i] === +date) return i; }; return -1; }; // then var idx1 = collection.indexOfDate(d);