Destructure / Easy Object Composition #1450
Replies: 2 comments
-
Posted at 2021-01-30 by Robin Sat 2021.01.30 Hi @josiahbryan,
That would be correct according to this reference beneath table ES6 From the MDN link in post#1 > 'The destructuring assignment syntax is a JavaScript expression that makes it possible to unpack values from arrays, or properties from objects, into distinct variables.' Were you after the exact Destruturing syntax shown in post #1, or would a similar JSON object notation work for the task at hand? ref: properties from objects
Note that use of
> re: 'Any plans to support these styles of operations?' We'll need to defer to @gfwilliams for the official plan. . . . |
Beta Was this translation helpful? Give feedback.
-
Posted at 2021-02-01 by @gfwilliams Yes, you're right - there's no support at the moment. Generally the state of language support is on the http://www.espruino.com/Features page as Robin says. However nothing stops you from transpiling your JS code into something else. For instance if you go to There's a wishlist here which you can vote on: espruino/Espruino#1302 And generally I do try and add the most requested features when I get time :) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2021-01-30 by JosiahBryan
Hey guys!
It seems that destructuring assignment and composition is not supported in Espurino...is that true? Or is there a way to enable it? (Destruturing: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment)
For example, this doesn't work:
Similarly, this doesn't work:
Any plans to support these styles of operations?
Beta Was this translation helpful? Give feedback.
All reactions