const someObject = { a: 1, b: 2 }
const { a, b } = someObject; // syntax errors on this line
const a = someObject.a; // ...but this does work
Similarly, this doesn't work:
const a = 1, b = 2;
const someObject = { a, b }; // syntax errors here
someObject.a = a; // ... but this works
Any plans to support these styles of operations?
Search Options
Types to Display
Espruino
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
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/DestÂructuring_assignment)
For example, this doesn't work:
Similarly, this doesn't work:
Any plans to support these styles of operations?