How can I do recursion?

Answered

I have the following table setup

I want to be able to enter a value of 7 and I want to get an array like [7,5,3,2,1].

Or if I enter a value of 3 I want to get an array like [3,2,1].

Generally speaking, when you do recursion you pass the function as a parameter to itself e.g.

int fib(int n)  {

    if (n <= 1) {

      return n;

}

   return fib(n - 1) + fib(n - 2);

}

This is what I currently have

https://www.loom.com/share/7fd496610665440f9354fad604a008d1

How can I pass a function to itself in Xano and/or what exactly am I don't incorrectly?

7 replies