Advertisement
Guest User

Untitled

a guest
Mar 29th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script>
  2. var way = "";
  3.  
  4. function RecFind2(list)
  5. {
  6.     for (var i = 0; i < list.length; i++)
  7.     {
  8.         var temp = list[i];
  9.         var nextList = list.slice();
  10.         way += temp;
  11.         nextList.splice(i,1);
  12.         if (nextList.length > 0) {RecFind2(nextList);}
  13.         else {document.writeln(way);}
  14.         way = way.slice(0,-1);
  15.     }
  16. }
  17.  
  18. var SomeName = [0,1,2,3];
  19. RecFind2(SomeName);
  20. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement