Why does const [x, y] = point put a number in x? On the right of an equals sign, [30, 50] makes an array. In a declaration, the brackets on the left describe how to read one. Destructuring lets you name the parts of a value by writing a pattern where you would otherwise write a single variable name.1
const point = [30, 50];
const [x, y] = point; // x = 30, y = 50
const click = { type: "click", position: point };
const { position: [left, top] } = click; // left = 30, top = 50
Read the second pattern from the outside in. The braces select the property named position. The brackets take its first two values in order. The new names are left and top. More generally, brackets can read any iterable, a value that supplies its items in sequence. With const or a function parameter, a pattern introduces names. In an assignment such as [x, y] = point, it writes to existing targets, so those targets must be writable.1
How early did a language let you unpack one value into several variables?
One particularly clear example appeared in The Main Features of CPL in 1963. Section 24 gives the example a, b, c := L. The right side is a single list variable. CPL takes its members and assigns them to the three variables on the left, in order. The authors called this simultaneous assignment. They also required both sides to have the same number of members. JavaScript allows a shorter input. In const [first, second] = [10], second gets undefined.21
The date depends on what counts. Victor Yngve's COMIT paper from 1958 already described matching parts of a text and numbering them so a translation rule could reuse them. John McCarthy's 1960 Lisp paper showed apply taking an argument list and pairing its elements with a function's parameters. Those are earlier examples of capturing parts and binding arguments. CPL gives us a dated example of the narrower feature a JavaScript reader would recognize immediately. One list value supplies several named destinations. Its publication establishes that the syntax existed by 1963. Who first devised it remains open.342
Did it come from mathematics?
Consider the instruction “let the point P have coordinates (x, y).” It gives us names for two parts of one mathematical object. A function on pairs can use those names immediately. For P = (3, 4), the function f(x, y) = x + y gives f(P) = 7. This is a useful mathematical reading of positional destructuring.
There is also a documented connection to lambda calculus, Alonzo Church's notation for describing functions and the variables they bind. In 1964 Peter Landin explained how to express simultaneous definitions by extending Church's notation to allow “a list of identifiers between the ‘λ’ and the ‘.’” His example has the form λ(u, v).…: applying the function to a pair gives its body names for both components. The word extending matters here. It identifies Landin's design step. The paper connects mathematical notation to a programming mechanism, while the immediate source for JavaScript's syntax can be identified much more precisely.56
Is destructuring a functional-programming idea?
It is a language feature that fits more than one programming style. The CPL example updates existing variables. A functional definition can use a pattern to give local names to the pieces of its argument. Functional programming also developed a related idea, pattern matching, in which the shape of the data can determine which piece of code runs.
Rod Burstall made the connection concrete in 1969. In his extension to Landin's functional language ISWIM, let cons(a, y) = x gives names to the head and tail of a nonempty list. Here cons is the operation that builds a list from a head and a tail. Writing it on the receiving side lets the reader see how to take the list apart. In Burstall's concatenation example, a separate test first determines whether the list has that form. In JavaScript, const { message } = result reads a property. If result is an empty object, message becomes undefined and execution continues. Choosing what to do with an error or a success takes an additional decision.71
Where did the word destructuring appear?
The Maclisp 1742 release notes, dated September 17, 1978, use the term in its familiar sense. Their description of the LET macro allows a pattern of variables in place of a single variable. One example uses (C () D) to pick the first and third items of a three-item list. The implementers describe the underlying work as “the destructuring operations of CAR and CDR”. In Lisp, those operations read the first part of a pair and the remainder. The pattern saves the programmer from spelling out each access.8
This dates the word in Lisp practice at least as far back as 1978. The release notes use it in passing, so they give us an example of usage and leave the question of who coined it unanswered.
How did the brackets and braces reach JavaScript?
In Mozilla's 2006 implementation discussion, Brendan Eich credited Lars T. Hansen of Opera with the proposal and recorded that array destructuring already worked in Opera. The proposal extended the familiar shapes of JavaScript's array and object literals to the receiving side of an assignment. One use case was an iterator returning a key and a value together. A caller could give those two values names in a single line. The discussion also shows patterns reaching into nested object properties.6
Python's sequence unpacking looks similar, and accounts of its influence differ. In 2007 Eich wrote that “Python had nothing to do with the destructuring assignment proposal” and pointed to a longer tradition in ML and other languages. A history he later co-authored groups destructuring with features modeled on Python. For the origin of this particular proposal, the 2006 record is more specific. It names the author, identifies the working Opera implementation, and reproduces the proposed syntax.9106
Mozilla shipped its version in Firefox 2 in October 2006. The sixth edition of ECMAScript standardized the feature in June 2015. Its two section titles explain a distinction you can still see in everyday code. In const [x, y] = point, a binding pattern introduces names. With x and y previously declared using let, [x, y] = point is a destructuring assignment that gives those variables new values.111210
References
Footnotes
-
MDN contributors. (2026, November 17). Destructuring. MDN Web Docs. Description, including “Binding and assignment”. ↩ ↩2 ↩3 ↩4
-
Barron, D. W., Buxton, J. N., Hartley, D. F., Nixon, E., & Strachey, C. (1963). The main features of CPL. The Computer Journal, 6(2), 134–143. §24, “Simultaneous assignment commands,” p. 140. ↩ ↩2
-
Yngve, V. H. (1958). A programming language for mechanical translation. Mechanical Translation, 5(1), 25–41. “Left half,” discussion of numbered constituents and Figure 7. ↩
-
McCarthy, J. (1960). Recursive functions of symbolic expressions and their computation by machine, Part I. Communications of the ACM, 3(4), 184–195. §3, “The Universal S-Function apply”. ↩
-
Landin, P. J. (1964). The mechanical evaluation of expressions. The Computer Journal, 6(4), 308–320. “Auxiliary definitions,” p. 309, paragraph on simultaneous definitions. ↩
-
Eich, B. (2006). Support destructuring assignment in JS1.7 [Bug 336379]. Mozilla Bugzilla. Description and use cases and comment 1, proposal and attribution to Hansen. ↩ ↩2 ↩3
-
Burstall, R. M. (1969). Proving properties of programs by structural induction. The Computer Journal, 12(1), 41–48. Table comparing extended ISWIM with ISWIM and the following concatenation example. ↩
-
Cannon, H. I., & White, J. L. (1978, September 17). LISP 1742 [Release notes]. LISP News. Item 1, detailed description of the LET macro, final paragraph. ↩
-
Eich, B. (2007, October 27). Comment on JavaScript 2: Everything but the kitchen sink. Numenware. Comment 1442, second paragraph. ↩
-
Wirfs-Brock, A., & Eich, B. (2020). JavaScript: The first 20 years. Proceedings of the ACM on Programming Languages, 4(HOPL), Article 77. Authors’ corrected copy, p. 62, final paragraph. ↩ ↩2
-
Fitzgerald, N., & Orendorff, J. (2015, May 28). ES6 in depth: Destructuring. Mozilla Hacks. Conclusion, first paragraph. ↩
-
Ecma International. (2015, June). ECMAScript 2015 language specification (ECMA-262, 6th ed.). §12.14.5, Destructuring Assignment and §13.3.3, Destructuring Binding Patterns. ↩