Date.parse(dateVal)
This method is very commonly used. For example, you can use it when verifying whether the input date exists. If it is a non-existent date, the return value will be NaN. In addition, if You can use it to compare the order of two dates, or to calculate the number of days between two dates.
I encountered a strange problem today when I used it to compare dates. It was about the date format. The parse method requires that short dates can use "/" or "-" as the separator, but the month must be used. /day/year format, for example, today is "7/6/2008" or "7-6-2008". The problem arises here. When using the format "7-6-2008", in It can be parsed normally in IE, but in FireFox, the return value is always NaN. At first, I thought it was a problem with the code. After checking, I found out that it was the browser. Later, I changed the format to "7/6/2008" and it can be parsed normally in IE and FF.