We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
You can
local a, b = 1, 2
However you cannot unpack something into a table and local variable at the same time. This code gives you a syntax error.
local myTable = {} local myTable.a, b = 1, 2
Likewise, you cannot move the local keyword, or you will get a syntax error.
local myTable = {} myTable.a, local b = 1, 2
It would be nice to be able to do the code above rather than manually unpacking it.
local myTable = {} local toUnpack = {1, 2} myTable.a = toUnpack[1] local b = toUnpack[2]
The text was updated successfully, but these errors were encountered:
It's possible to forward-declare a local variable first before assigning.
local toUnpack = { 1, 2 } local myTable = {} local b: number myTable.a, b = unpack(toUnpack)
This should give you the same behavior.
Sorry, something went wrong.
Oh, thank you I forgot about that!
No branches or pull requests
You can
However you cannot unpack something into a table and local variable at the same time. This code gives you a syntax error.
Likewise, you cannot move the local keyword, or you will get a syntax error.
It would be nice to be able to do the code above rather than manually unpacking it.
The text was updated successfully, but these errors were encountered: