Y
Hacker News
new
|
ask
|
show
|
jobs
An introduction to ES6 Part 3: Destructuring
(
globaldev.co.uk
)
24 points
by
timblair
4640 days ago
4 comments
teamnyble
4640 days ago
Combine this with arrow function syntax (which is already in Firefox):
let square = x => x * x
And the next version of JavaScript is looking much more fun to work with!
link
spoiler
4640 days ago
Chrome also supports it if you enable Harmony
link
teamnyble
4640 days ago
Really? I have harmony enabled in chrome://flags, but no arrow function syntax?
link
spoiler
4640 days ago
Hmm, I am using the Dev channel Chrome. So, it might be not in the stable (or even beta) release? It definitely worked for me when I tried it, though!
link
Jasper_
4639 days ago
It even works for argument lists too:
function foo(a, { b: b, c: c }, [d, e]) { print (a, b, c, d, e); }
link
j_m_b
4640 days ago
I didn't know js had a let statement.
link
timblair
4640 days ago
Have a look at the previous instalment of the series:
http://globaldev.co.uk/2013/09/es6-part-2/#let_declarations
link
redcircle
4640 days ago
Does anyone call it ES?
link
jallardice
4640 days ago
What do you mean? ES6 is called ES6... what else can you call it, aside from Harmony?
link
unwind
4640 days ago
Some call it JavaScript.
link
opendomain
4640 days ago
Javascript 2.0
link
camus
4640 days ago
Ecma Script is the official name, Javascript belongs to Oracle,but since they are not enforcing the trademark , I doubt anybody could get sued over this.
link