The following code contains a bug (that I occasionally trip over): const re = /x/; const str = 'xaxa'; let match; while (match = re.exec(str)) { console.log(match[0]); } Answer: http://speakingjs.com/es5/ch19.html#RegExp.prototype.exec … (1st subheading = bug, 2nd subheading = correct)
-
-
Indeed! That’s why I like that method so much. http://2ality.com/2018/02/string-prototype-matchall.html …
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
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.