Skip to content

Comment on ES6 in Depth: Destructuringparent

Comments

My question is, why? If one wanted this type of guarantee consistently, they might as well use a statically typed language.

Add: To clarify, the error shows up at runtime in Python. So you're going to need tests anyway. Just as in JS.

Btw (unrelated), you can do the same thing in JS as well [a, b, ...rest] = [1, 2, 3, 4, 5]

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.