Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Regexp performance is faster when you "precompile" (examples from JavaScript Performance Rocks!)
function directPassing ( string )
return string.match( /abc/ );
var REGEXP = /abc/;
function variablePassing( string )
return string.match( REGEXP );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.