Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
sesutton
on May 29, 2015
|
parent
|
context
|
favorite
| on:
ES6 in Depth: Destructuring
You could just write:
let [tenth_item] = somearray.slice(9)
bmn_
on May 29, 2015
[–]
You're missing the point here. Slice works with only part of the compound about to be ripped apart. However, destructuring with commas is generic. Example that has no simple slice method call:
let [,second,,fourth,,sixth]
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: