Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let x = {};
- x.str = 'Hello Wornld';
- x.a = /s/g;
- x.action = new Function(x.str, x.a, 'return ' + x.str + '.replace(' + x.a + ', "")');
- console.log(x.action);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement