Tip – you can object-destructure Arrays: const {0:x, 2:y} = ['a', 'b', 'c']; assert.equal(x, 'a'); assert.equal(y, 'c'); Why does that work? Array indices are also properties. https://exploringjs.com/impatient-js/ch_destructuring.html#object-destructuring …
-
-
I (slightly) prefer it for simple, obvious regexes. Once regular expressions become more complex, I prefer named capture groups or I compose viahttps://github.com/rauschma/re-template-tag …
-
Agreed. Named capture groups have the tendency to make the regex less readable, but the tipping point is there, somewhere.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
JavaScript, HTML, CSS, HTTP, performance, security, Bash, Unicode, i18n, macOS.