M
Matìj Cepl
Hi,
I have this piece of code
var chosenPair = list.filter(
function (pair) {
return new RegExp(pair.regexp, "i").test(chosingMark);
});
(I hope that particulars of the list data structure are not important
for my question)
I put that new there under the influence of
http://yuiblog.com/blog/2006/11/13/javascript-we-hardly-new-ya/
but I am not sure, whether the same strong need for new is there even
when I just use its .test() method and when (I guess) the object will be
garbage collected almost immediately.
What do you think?
Matìj
--
http://www.ceplovi.cz/matej/, Jabber: mcepl<at>ceplovi.cz
GPG Finger: 89EF 4BC6 288A BF43 1BAB 25C3 E09F EF25 D964 84AC
Las cosas claras y el chocolate espeso.
(Ideas should be clear and chocolate thick.)
-- Spanish proverb
I have this piece of code
var chosenPair = list.filter(
function (pair) {
return new RegExp(pair.regexp, "i").test(chosingMark);
});
(I hope that particulars of the list data structure are not important
for my question)
I put that new there under the influence of
http://yuiblog.com/blog/2006/11/13/javascript-we-hardly-new-ya/
but I am not sure, whether the same strong need for new is there even
when I just use its .test() method and when (I guess) the object will be
garbage collected almost immediately.
What do you think?
Matìj
--
http://www.ceplovi.cz/matej/, Jabber: mcepl<at>ceplovi.cz
GPG Finger: 89EF 4BC6 288A BF43 1BAB 25C3 E09F EF25 D964 84AC
Las cosas claras y el chocolate espeso.
(Ideas should be clear and chocolate thick.)
-- Spanish proverb