Javascript examples for Function:Function Recursion
Run nested function
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=( function() {// www .jav a2s . c o m var m = 0; var d = 0; console.log(m+++":" + ++d); function getCtr() { var i = 0; return function() { console.log(++i); } } var ctr = getCtr(); ctr(); ctr(); }); </script> </head> <body> </body> </html>