Advertisement
Guest User

Untitled

a guest
Nov 18th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var str1 = 'table football';
  2. var regex1 = new RegExp('foo','y');
  3.  
  4. regex1.lastIndex = 6;
  5.  
  6. console.log(regex1.sticky);
  7. // expected output: true
  8.  
  9. console.log(regex1.test(str1));
  10. // expected output: true
  11.  
  12. console.log(regex1.test(str1));
  13. // expected output: false
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement