Advertisement
Guest User

Untitled

a guest
Nov 27th, 2014
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. function recur(data) {
  2. data = data+1;
  3. var nothing = function() {
  4. recur(data);
  5. }
  6. nothing();
  7. }
  8.  
  9. (function(data){
  10. data = data+1;
  11. var nothing = function() {
  12. //Something here that calls the function?
  13. }
  14. nothing();
  15. })();
  16.  
  17. (function foo() { foo(); })();
  18.  
  19. asyncThingWithCallback(params, (function() {
  20. function recursive() {
  21. if (timeToStop())
  22. return whatever();
  23. recursive(moreWork);
  24. }
  25. return recursive;
  26. })());
  27.  
  28. (function foo(data){
  29. data++;
  30. var nothing = function() {
  31. foo(data);
  32. }
  33. nothing();
  34. })();
  35.  
  36. var Y = function (gen) {
  37. return (function(f) {
  38. return f(f);
  39. }(function(f) {
  40. return gen(function() {
  41. return f(f).apply(null, arguments);
  42. });
  43. }));
  44. }
  45.  
  46. (Y(function(recur) {
  47. return function(data) {
  48. data = data+1;
  49. var nothing = function() {
  50. recur(data);
  51. }
  52. nothing();
  53. }
  54. })());
  55.  
  56. (function(data){
  57. var recursive = arguments.callee;
  58. data = data+1;
  59. var nothing = function() {
  60. recursive(data)
  61. }
  62. nothing();
  63. })();
  64.  
  65. (foo = function() { foo(); })()
  66.  
  67. (recur = function(data){
  68. data = data+1;
  69. var nothing = function() {
  70. if (data > 100) return; // put recursion limit
  71. recur(data);
  72. }
  73. nothing();
  74. })(/* put data init value here */ 0);
  75.  
  76. ({
  77. do: function() {
  78. console.log("don't run this ...");
  79. this.do();
  80. }
  81. }).do();
  82.  
  83. (function () {
  84. // Pass
  85. }());
  86.  
  87. (function foo () {
  88. foo();
  89. }());
  90. foo //-> undefined
  91.  
  92. var initialValue = ...
  93.  
  94. (function recurse(data){
  95. data++;
  96. var nothing = function() {
  97. recurse(data);
  98. }
  99. if ( ... stop condition ... )
  100. { ... display result, etc. ... }
  101. else
  102. nothing();
  103. }(initialValue));
  104.  
  105. var functionCaller = function(thisCaller, data) {
  106. data = data + 1;
  107. var nothing = function() {
  108. thisCaller(thisCaller, data);
  109. };
  110. nothing();
  111. };
  112. functionCaller(functionCaller, data);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement