Thank you very much for reaction and kind response. I believe, my errors are connected with complexity of the initial task that is about to compare dates against some constants and counting them also, sorting and different formats when compared... Simply, I did not have fast scripting skill, so your help is appreciate very much ... I did not describe the whole intention initially. The Idea was to get several evaluation angles from single answer to the single question.
My scenario:
The dates in myarray[] always mean several things, so I need to interpret them by some logic: 1) Dates in a past incl. today (all should be first compared against Today, of course) should total count as numberofpastdates, 2) future dates should be total count as numberoffuturedates, plus, 3) the latest future date should be assigned to the new variable, 4) if no future dates are provided, the var x should get value false, 5) Whole empty array cells (date is not provided by respondent) should be total count as nodatesprovidednumber and, finally, 6) the particular dates, say equal to YYYY-MM-DD, should be total count as particulardatesnumber.
I have used while() and case(true) statements and expressions, but finally messed up with the script and lost in space.

Depending on my next 3 days success, our ~3000 respondents will or will not get valuable statistical graph on their last page; btw, thanks for google graph libraries... Here is not a profitable project, only my afterhours intention to have the survey better shaped than standard "acceptable" level.
Thanks again for your kind support and invaluable ideas.