Let's say I have this code:
local testtbl = {"foo", "bar", "baz"}
How do I get the index of an element? For example:
print(indexOf(testtbl, "bar")) -- 2
Let's say I have this code:
local testtbl = {"foo", "bar", "baz"}
How do I get the index of an element? For example:
print(indexOf(testtbl, "bar")) -- 2
Copyright © 2021 Jogjafile Inc.
You need to iterate over the table with
ipairs, like so: