ES6 Overview in Bullet Points
github.com
ES6 Overview in Bullet Points
1–10 of 50 posts
Re: ES6 Overview in Bullet Points
#2Re: ES6 Overview in Bullet Points
#3Re: ES6 Overview in Bullet Points
#4var {foo} = pony is equivalent to var foo = pony.foo var {foo: baz} = pony is equivalent to var baz = pony.foo
I am not sure why, but most languages get into a state where they seem to encourage non-readable code. What was wrong with 'var baz = pony.foo' to start with?
Re: ES6 Overview in Bullet Points
#5Looking good and informative, but to be honest I am really interested in use cases. I think I understand how to use generators but I have no idea where I could use them in real-world scenarios. Same goes for WeakMaps, Proxies... Anyone care to give some examples?
Re: ES6 Overview in Bullet Points
#6But anyway, seriously, this is awesome. The author is responsible for a large part of my ES6 knowledge.
Re: ES6 Overview in Bullet Points
#7Great writeup. I welcome most of the additions, but I somehow cannot get behind things like: var {foo} = pony is equivalent to var foo = pony.foo var {foo: baz} = pony is equivalent to var baz = pony.foo I am not sure why, but most languages get into a state where they seem to encourage non-readable code. What was wrong with 'var baz = pony.foo' to start with?
var { foo } = pony
I agree this is kind of silly in isolation, but more often than not, its used like this: var { foo, bar, baz } = pony
which is honestly not that hard to read, and is much better than var foo = pony.foo;
var bar = pony.bar;
var baz = pony.baz;
which is very useful when you're referencing properties of pony a lot. Since you're going to see destructuring used like var { foo, bar, baz } = pony
typically, I think its a very nice idea to always do your variable assignments like that even when its a little obtuse. I'd rather not see multiple styles for variable assignment. var { foo: f } = pony
is just there as an escape hatch in case foo already exists in the namespace. It is not something you would typically do.Re: ES6 Overview in Bullet Points
#8Great writeup. I welcome most of the additions, but I somehow cannot get behind things like: var {foo} = pony is equivalent to var foo = pony.foo var {foo: baz} = pony is equivalent to var baz = pony.foo I am not sure why, but most languages get into a state where they seem to encourage non-readable code. What was wrong with 'var baz = pony.foo' to start with?
import {Button, Text} from 'react-native';
and in function declarations:
function f({foo, bar})
Re: ES6 Overview in Bullet Points
#9Looking good and informative, but to be honest I am really interested in use cases. I think I understand how to use generators but I have no idea where I could use them in real-world scenarios. Same goes for WeakMaps, Proxies... Anyone care to give some examples?
Proxies can be used for data-binding, similar to Object.observe.
I've also yet to find a case where I need WeakMaps instead of an Object or Map. All the benefits seem to be a bit too theoretical, but I likely haven't dug into it hard enough.
Re: ES6 Overview in Bullet Points
#10Great writeup. I welcome most of the additions, but I somehow cannot get behind things like: var {foo} = pony is equivalent to var foo = pony.foo var {foo: baz} = pony is equivalent to var baz = pony.foo I am not sure why, but most languages get into a state where they seem to encourage non-readable code. What was wrong with 'var baz = pony.foo' to start with?
the core use case is var { foo } = pony I agree this is kind of silly in isolation, but more often than not, its used like this: var { foo, bar, baz } = pony which is honestly not that hard to read, and is much better than var foo = pony.foo; var bar = pony.bar; var baz = pony.baz; which is very useful when you're referencing properties of pony a lot. Since you're going to see destructuring used like var { foo, bar,…
return {a, b, c} = foo;