I have learned recently that I can do this sort of stuff:
local function concatunate(a: string?, b: string?)
return a..b
end
Restricting the arguments to be one data type. I was trying to do this earlier for functions and for tables but when I put something around the lines of:
local function DoFunction(func: function?, args: table?)
return func(unpack(args))
end
What are the data types to make this correct?
Where can I find those to do this sort of thing?
Basically, a function is in the notion of (args) -> returnArgs, and a table is in the notion of {itemType} for arrays and {[keyType]: itemType} for dictionaries.
So for your function, you might have something like this:
local function DoFunction(func: () -> (), args: {string})
end
A function of type () -> () takes no arguments and returns nothing. A table of type {string} is an array of strings.