Open chrisdp opened 5 years ago
Can you provide an example in brighterscript syntax and then the complied brightscript?
BrighterScript Array
foo = ["one", "two", "three"]
([one, two, three] = foo)
print one
' Output: one
print two
' Output: two
print three
' Output: three
BrightScript Array
foo = ["one", "two", "three"]
one = foo[0]
two = foo[1]
three = foo[2]
print one
' Output: one
print two
' Output: two
print three
' Output: three
BrighterScript Object
o = {p: 42, q: true};
({p, q} = o)
print p
' Output: 42
print q
' Output: true
BrightScript Object
o = {p: 42, q: true};
p = o.p
q = o.q
print p
' Output: 42
print q
' Output: true
@TwitchBronBron There are many more but as this would be a good start. Here is the javascript doc I am looking at for reference. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment
Like we have in javascript, support for this would be very covenant.