← Back to challenges

Date Format

JavaScriptHardformattingdatesarrays

Instructions

Create a function that converts a date formatted as MM/DD/YYYY to YYYYDDMM.

Examples

formatDate("11/12/2019") ➞ "20191211"

formatDate("12/31/2019") ➞ "20193112"

formatDate("01/15/2019") ➞ "20191501"

Notes

Return value should be a string.

javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Binary to Decimal Converter