Java Script check date range is valid or not

Q:- I want to validate date range or if exist date range by using java script.
Answer :-
This is can be done using Date() object.Look at the following function.It will return date range is valid or not.Simply you have to pass start date and end date only.

You can check this using console panel of the firebug.