LuaU Type for a Normal Table

Hello! I’m starting to learn LuaU, but I’m trying to make a table that has different value names for them, but the LuaU rules are not letting me do it. Example:

local MyTable:table = {
     [1] = "Hey!"
     [2] = "Lol!"
}

It says that Unknown Type 'table', but I don’t know why is this happening.

Can someone help me? :heart:

There is no generic table type yet, but you can do

type array = { any }

local my_table: array = { "Hey!", "Lol!" }

to get a generic array type.

Also, it’s Luau, lowercase “u” :slight_smile:

6 Likes

Oh! Thank you so much for telling me, I didn’t know that any was a thing, and sorry for putting the u in Luau! :heart:

1 Like