completed and corrected date exercise in javascript with comments