ES6 RegExp global


ES6 RegExp global

var re = new RegExp( "string" );
if ( re.global ) {
   console.log("Test1 - Global property is set");  
} else {
   console.log("Test1 - Global property is not set");  
}
re = new RegExp( "string", "g" );

if ( re.global ) {
   console.log("Test2 - Global property is set");  
} else {
   console.log("Test2 - Global property is not set");  
}