home.social

#whyglobals — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #whyglobals, aggregated by home.social.

  1. developer.mozilla.org/en-US/do

    > JavaScript RegExp objects are stateful when they have the global or sticky flags set (e.g. /foo/g or /foo/y). They store a lastIndex from the previous match.

    Look on, and weep, for we have entered the realm of client-side PHP.

    Early-aborting a RegExp.exec-based loop – and lazy evaluation's the only thing this is useful for – without manually resetting an internal property will cause subtle bugs that are hard to spot.