Answers for "lua sum of array"

Lua
0

lua sum of array

local function sum(sequence)
    local temp = 0
    for i = 1, #sequence do
        temp = temp + sequence[i]
    end
    return temp
end
Posted by: Guest on March-05-2022

Browse Popular Code Answers by Language