ES6 RegExp.prototype.sticky


ES6 RegExp.prototype.sticky

var str = "Javascript is an interesting scripting language";
var re = new RegExp( "script", "g" );
re.test(str);
console.log("Test 1 - Current Index: " +  re.lastIndex);  
re.test(str);
console.log("Test 2 - Current Index: " + re.lastIndex)