Is lua auto garbage collecting this variable?

*Example Code

local function add(x, y)
    local result = x + y

    return result
end

In this code, is the result variable garbage collected after being returned?

Yes, the result is garbage collected after being returned, provided there are no references to it elsewhere.

Thanks for replying with the answer!

Lua, Python, JavaScript – Garbage-Collected
C, C++ – Manual Management