Help with a line of code

Hello, recently I have added some Toolbox models in my world to see their code, in short, I found a line of code that the truth, I am quite puzzled, in a function there was a return, returning a function.

return function()

Can someone explain to me what this return does and what is the use of putting it?

1 Like

You can return a function call inside of a function. Basically what will happen is the return value of the called function, in this case function, will be returned so if function returns 5, then the return value of the function returning function() will be 5.

Here’s a demo:

2 Likes