The ability to reply to discussions is limited to PRO members. Want to join in the discussion? Click here to subscribe now.

Destructuring Assignment in ES6

Destructuring Assignment in ES6

4:33
ECMAscript 6 destructuring provides flexible options for variable assignment.
Watch this lesson now
Avatar
egghead.io

ECMAscript 6 destructuring provides flexible options for variable assignment.

Avatar
Roman Ganchenko

I wonder how this all functionality will be supported in CoffeeScript.

In reply to egghead.io
Avatar
Kevin

CoffeeScript has supported destructuring/deconstructor assignments for a while, so it wouldn't be hard to perhaps tweak it to accommodate ES6 JS Output.

Since the language values backwards compatibility, such behavior will likely be behind a --harmony or --es6 flag.

In reply to Roman Ganchenko
Avatar
Roman Ganchenko

What's up Kevin :-) Such a surprise to see you here

In reply to Kevin
Avatar
Mike

Is there a video which demonstrates how to setup WS to run the ES6 files through Traceur?

Is this built into WS, or something different?

In reply to egghead.io
Avatar
Robert

https://www.youtube.com/watch?v=jbfkcmxLLKY

It's for webstorm 8 but works for version 9 too

In reply to Mike
Avatar
Dipankar

Destructuring is a shortcut syntax. Assignment of Skyler to Skyler object forced me to rewind.

Avatar
Zhenyang Hua

Is destructuring often used in modules import ? e.g. import { XX } from 'xxx/core' ?

Avatar
Stephan

Hi, it is a pity that you mix old ECMA 5 and ECMA 6 script together in every session of the course "Learn ES6 (ECMAScript 2015)".
So it would be nice to just use "let" instead of "var" always. And for sure some the other stuff you very nicely introduce.
So would would have a much better learning effect.

But I love your way of introducing things in short videos.

Avatar
Jesse

At about the two minute mark, when you use state:location the state becomes part of your url on reload.
The page returns a file not found error as es6/index.html becomes es6/New%20York. So location is a keyword to be avoided.

Avatar
Gene

Code in transcript is wrong.

[,Skyler] = people;

Should be:

[Skyler,] = people;
Avatar
Mike

Great examples. Your videos are one of the reasons I subscribe to Egghead.

HEY, QUICK QUESTION!
Joel's Head
Why are we asking?