question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[beta] ES6: Use Destructuring Assignment with Objects - description errors

See original GitHub issue

Challenge use-destructuring-assignment-with-objects has an issue. User Agent is: Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:51.0) Gecko/20100101 Firefox/51.0. Please describe how to reproduce this issue, and include links to screenshots if possible.

In description it says:

“Consider the following ES5 code:”


const voxel = {x: 3.6, y: 7.4, z: 6.54 };
const x = voxel.x; // x = 3.6
const y = voxel.y; // y = 7.4
const z = voxel.z; // z = 6.54

“const” is ES6, should be “var”?

Also: is below code correct? Are there “a”, “y”, “z” on purpose, maybe to show that you can use xyz and abc?

    const { x : a, y : b, z : c } = voxel // a = 3.6, y = 7.4, z = 6.54

edit: I clicked “Run tests” to see some errors descriptions, but instead of errors I got confirmation of solved challenge (and all tests passed even though I didn’t change anything in code yet).

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
QuincyLarsoncommented, Feb 24, 2017

@Ethan-Arrowood thanks for offering to help.

@BerkeleyTrue what’s the status of ES6 transpilation?

1reaction
Ethan-Arrowoodcommented, Feb 21, 2017

@Greenheart

there’s a problem when we transpile the code from ES6 to ES5 (so that it actually can run in browsers).

Do you need assistance in setting up a webpack config file? I can probably lend a hand here if thats the case.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Destructuring assignment - JavaScript - MDN Web Docs
The destructuring assignment syntax is a JavaScript expression that makes it possible to unpack values from arrays, or properties from objects, ...
Read more >
ES6 Destructuring Assignment - Medium
Destructuring assignment is syntactic sugar for neat assignment of values taken directly from an object. Below are the different ways ES6 ...
Read more >
Destructuring Assignment in JavaScript - GeeksforGeeks
Destructuring Assignment is a JavaScript expression that allows to unpack values from arrays, or properties from objects, into distinct ...
Read more >
ES6 Use Destructuring Assignment to Assign Variables from ...
The example talks about using commas to get to a certain index in an array so you can assign a value in that...
Read more >
ES6: Use Destructuring Assignment to Assign Variables from ...
I find the question confusing because it's not obvious that a string is an object that has a length property, whereas this is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found