Created
February 5, 2020 18:25
-
-
Save DesignFront/05b23a411bb10308655a0c7536cdf6a0 to your computer and use it in GitHub Desktop.
Regex destructuring
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const [, year, month, day] = /^(\d\d\d\d)-(\d\d)-(\d\d)$/.exec('2999-12-31'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment