Climb n | Function to calculate leaps ; Driver Code
function calculateLeaps ( n ) { if ( n == 0 n == 1 ) { return 1 ; } else { let leaps = 0 ; for ( let i = 0 ; i < n ; i ++ ) leaps += calculateLeaps ( i ) ; return leaps ; } } document . write ( calculateLeaps ( 4 ) ) ;