JS Advanced --- recursion

Recursion

 

Recursion: function call the function yourself, this time is recursive, recursion conditions must be ended
 
    var I = 0 ;
     function F1 () { 
      I ++ ;
       IF (I <. 5 ) { 
        F1 (); 
      } 
      the console.log ( "Once there was a mountain, the mountain has a temple, temple has monk to speak monk story " ); 

    } 

    f1 ();

 

 

 

Guess you like

Origin www.cnblogs.com/jane-panyiyun/p/12185817.html