Should i use semi- colons or commas to seperate items in a table?

I was recently learning how to use module scripts and and thought you could only use semi - colons to separate items in a table but apparently you can use commas too?!

I need some help.

1 Like

you use what you want, they dont have any difference for tables

Both work for tables. It’s more of the feel and looks of your script design that you would get from it. Semicolons can be used exactly like commas, vice versa. You can also put semicolons at the end of your code lines to have more of a professional look to it, but it rarely matters.

3 Likes

You could refer to this if you want:

The choice is yours and usually what one uses to separate items is based on preference (both work). For example, I sort my like this:

local tbl = {
    Example1 = {
        1, "Yes", true --Non-table values sorted with commas
    }; --Inner table values sorted with semi-colons
    Example2 = {
        2, "No", false
    };
}

Thanks for clearing that up everyone!! I think ill just put commas as i like them better.