Skip to content

Instantly share code, notes, and snippets.

@guysmoilov
Last active September 30, 2015 12:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save guysmoilov/e3d172e9b8900abb1d29 to your computer and use it in GitHub Desktop.
Save guysmoilov/e3d172e9b8900abb1d29 to your computer and use it in GitHub Desktop.
var recursive = "var iterationNum=ITERATION_NUM; console.log('iteration number %s', iterationNum); var recursive = \"REPLACE\"; eval(recursive.replace('REPLACE', recursive.replace(/\\\\/g, '\\\\\\\\').replace(/\"/g, '\\\\\"').replace(/'/g, '\\\\\\'')).replace('ITERATION_NUM', iterationNum + 1))";
eval(recursive.replace('REPLACE', recursive.replace(/\\/g, '\\\\').replace(/"/g, '\\"').replace(/'/g, '\\\'')).replace('ITERATION_NUM', 0));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment