How can I get the index number of this?

How can I get the index number of “TEST”. It keeps returning nil and I am not quite sure how I can find this information.

local comp = {}

table.insert(comp, "TEST");

local indexNuumb = comp["TEST"]
print(indexNuumb)
1 Like

table.find should work fine:

local comp = {}

table.insert(comp, "TEST");

local indexNuumb = table.find(comp,"TEST")
print(indexNuumb)
3 Likes

Thanks. For some reason I could not remember how to get it lol

1 Like