Date. parse (dateVal)
This method is very common. For example, you can use it to verify whether the input date exists. If it is a non-existent date, the return value will be NaN, in addition, it can be used to compare the order of two dates or calculate the number of days for the difference between the two dates.
Today, I encountered a strange problem when I used it to compare the date sequence. It is about the date format. The parse method requires that the short date can use "/" or "-" as the separator, however, the format must be monthly, daily, or yearly. For example, if the format is "7/6/2008" or "7-6-2008", the problem occurs here. When the format "7-6-2008" is used, 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 the code, I found it was the cause of the browser. Later I changed the format to "7/6/2008" and then it could be parsed in IE and FF.