Brendan Eich wrote:
js> ["fOo","bAr"].filter(function(){return /foo/i});
["fOo", "bAr"]
LOL, I returned a truthy value. Fixing:
js> ["fOo","bAr"].filter(function(s){return /foo/i.test(s)});
["fOo"]
Even longer :-/.
So yes, callable regexps were useful -- that's why I made 'em callable
way back when (Netscape 4 impl, based on Perl 4[!], fed into ES3). But
they wound up being outlawed by ES3's text.
/be
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss