_dhar’s Twitter Archive
—№ 4,040
⇤ Newest
Tweet
⇠ Newer
Tweet
Older
Tweet
⇢
ES6 destructuring applies nicely with RegExp
@simevidas/662148496066273281
On twitter.com
♻️ 1
Retweets
2015 Nov 5
Mood
0
…in reply to @_dhar
Even better with defaults, to avoid a TypeError if it doesn't match: let {1: name, 2: num} = /(\D+)(\d+)/.exec('##') || [, '', 0];
Permalink
On twitter.com
2015 Nov 5
Mood +
1
🙂