-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
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
Destructuring arrays and objects. #684
Comments
This might be doable as Rhai only contains two literal syntax that can be matched against: arrays and maps. I'll look into that. But then, once we match on arrays, we probably need the spread operator So it must consider all possible combinations: And if you add |
It would be nice if we had syntax to destructure arrays, objects and other types.
Syntax could look something like this:
This is similar to JavaScript and this also lets you emulate tuples! Like:
The text was updated successfully, but these errors were encountered: