I shouldn't say I actually have a "problem" (the code seems to... work? Although one time it through an error in the console possibly due to environmental reasons), but I'm picking apart a piece of code and I see this:
key = key.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
"key" is passed into the function containing this line. As you might expect, it's a string that's ultimately used as the needle in a haystack.
It's sanitizing something, but I can't figure out what it's sanitizing (primarily because I don't have any fluency in regex I guess). JSLint is barking about something also (Unexpected ']') but I think it's a false positive because it's not parsing the regex.
Wasn't sure to ask this at Stack Overflow or at Code Review, but it's not really "review" so here it is.
Any insight from you regexy type people would be much appreciated.
jQuerytag and not for thejavascripttag ?