added solution#2674
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your solution is approved because it correctly implements all the required formatDate behavior: it parses the input date using the fromFormat separator, reorders the parts according to toFormat, changes separators when needed, and handles YY/YYYY conversions following the specified 20/19 rule and last-two-digits logic. The examples described in the task (changing only the separator, reordering components, and converting between YYYY and YY in both directions) are all handled by your current implementation.
One minor point for future improvement: your code assumes the separator is always at a fixed index in the format arrays, which is fine for this task but slightly reduces flexibility if the format array structure ever changes. A more robust approach would be to derive the separator from the last element of the format arrays (e.g., fromFormat[fromFormat.length - 1]). Overall, the core requirements are met, there are no functional blockers, and your implementation is clear and aligned with the specification—nice work.
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
No description provided.