I am writing a function that just looks up values inside of a table. Is it possible to call that function inside of itself? I’ve seen stuff about this and self and don’t really understand it.
I am writing a function that just looks up values inside of a table.
Share
Yes, you can. It’s called recursion.
Of course you need to return from it to avoid infinite recursive calls. Failing to return will cause a stack overflow. Here’s a better example: