Whats the sens of the following line?:
todaysDate = todaysDate.getMonth() + 1 + '/' + todaysDate.getDate() + '/' + todaysDate.getFullYear();
I did in my last project like this (I had to control if a token is expired):
var today = new Date();
if (compareTime > today.getTime()) {
...
}