-
Sat 2021.01.30
Hi @JosiahBryan,
'destructuring assignment and composition is not supported in Espurino'
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
const someObject = { 'a': 1, 'b': 2 }; const a = someObject.a; console.log ( "Value a: " + a ); // output >Value a: 1
Note that use of
dump()
will show the same as:const someObject = { a: 1, b: 2 }; const a = someObject.a; console.log ( "Value a: " + a ); // output >Value a: 1
re: 'Any plans to support these styles of operations?'
We'll need to defer to @Gordon for the official plan. . . .
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?