On 21 August 2011 18:30, Danilo Celic <[email protected]> wrote:
> Nick,
>
> I think that you can get away with only using the RegExp once (especially
> since the code you sent set the RegExp into a variable, uses that once, and
> then you use another RegExp literal in your return statement):

That was an incomplete refactoring! I did have two regex literals,
then I assigned the first to `invalidIdentifier`, but forgot to
replace the second regex literal with `invalidIdentifier` :/

But yes, you're right, I could've just done RegExp#replace once,
rather than a match followed by a replace.

Cheers :)
-- 
Nick Morgan
http://skilldrick.co.uk
@skilldrick

Save our in-boxes! http://emailcharter.org

-- 
To view archived discussions from the original JSMentors Mailman list: 
http://www.mail-archive.com/[email protected]/

To search via a non-Google archive, visit here: 
http://www.mail-archive.com/[email protected]/

To unsubscribe from this group, send email to
[email protected]

Reply via email to