It's a traditional Regex syntax in several languages including JS (relevant here), Perl, and going way back to ancient Unix tools such as vi and ed.
The vi/ed form you often see in HN and other technical discussion memes too, such as:
s/easy/hard
Which is a joke to substitute uses of the word "easy" with "hard". The slashes mark a RegEx so you can get really clever in such jokes, though usually most such jokes are simple word substitutions.
The vi/ed form you often see in HN and other technical discussion memes too, such as:
s/easy/hard
Which is a joke to substitute uses of the word "easy" with "hard". The slashes mark a RegEx so you can get really clever in such jokes, though usually most such jokes are simple word substitutions.