# Positional binding after rest binding?

**URL:** https://es.discourse.group/t/positional-binding-after-rest-binding/2380
**Category:** 💡 Ideas
**Created:** [June 10, 2025, 5:32am UTC](https://es.discourse.group/t/positional-binding-after-rest-binding/2380 "2025-06-10T05:32:32Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![claudiameadows](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/claudiameadows/32/126_2.png) [@claudiameadows](https://es.discourse.group/u/claudiameadows)
#### Post date: [June 10, 2025, 5:32am UTC](https://es.discourse.group/t/positional-binding-after-rest-binding/2380/1 "2025-06-10T05:32:32Z")

</div>

Related: [rest end only but not rest start only?](https://es.discourse.group/t/rest-end-only-but-not-rest-start-only/1788)

_I also recall this being discussed on the old es-discuss mailing list, but dredging through that isn't something I feel like doing._

I'd like to see stuff like `(a, ...bs, c) => ...` be possible. To name a few examples of use case and precedent:

- Node's callback idiom the whole time has been `f(...args, callback)`, and any function forwarding all but the callback needs to have such a prototype.
- [GitHub - scijs/ndarray: 📈 Multidimensional arrays for JavaScript](https://github.com/scijs/ndarray) has an `ndarray.set(...indices, value)`.
- CoffeeScript supported this since before ES6. ES6 got its very rest parameter idea in part from it, so it's pretty strong precedent. I think Babel and/or Traceur also once supported it as an extension way back then.

There's of course a lot more, and I could probably spend hours just finding and adding precedent here.

---

<div class="post-metadata">

### Author: ![claudiameadows](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/claudiameadows/32/126_2.png) [@claudiameadows](https://es.discourse.group/u/claudiameadows)
#### Post date: [June 10, 2025, 5:35am UTC](https://es.discourse.group/t/positional-binding-after-rest-binding/2380/2 "2025-06-10T05:35:45Z")

</div>

I also found this, and I'm not sure why it didn't show up in my search results: [Inverse Rest Operator](https://es.discourse.group/t/inverse-rest-operator/1973)

This is a near dupe of that, just a little more detailed.

---

<div class="post-metadata">

### Author: ![michael](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/michael/32/11_2.png) [@michael](https://es.discourse.group/u/michael)
#### Post date: [June 25, 2025, 5:41pm UTC](https://es.discourse.group/t/positional-binding-after-rest-binding/2380/3 "2025-06-25T17:41:04Z")

</div>

I think this would be great. If I recall correctly from when rest parameters were added, the restriction was not due to any objections or challenges, it was just to make a small first step.

Note that we'll have to make sure there's an easy way for the average developer to understand the interactions between non-final rest parameters and default parameters. Banning their mixing is probably the easiest way to go about it.

---

<div class="post-metadata">

### Author: ![tabatkins](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/tabatkins/32/170_2.png) [@tabatkins](https://es.discourse.group/u/tabatkins)
#### Post date: [June 25, 2025, 7:55pm UTC](https://es.discourse.group/t/positional-binding-after-rest-binding/2380/4 "2025-06-25T19:55:46Z")

</div>

> If I recall correctly from when rest parameters were added, the restriction was not due to any objections or challenges, it was just to make a small first step.

Yeah, avoiding `[...foo, bar]` let us skip answering some hard questions and just get the 90% use-case solved. No matter what you define, people can expect different behavior for `let [a, ...b, c] = [1]`/etc, so it's a much tougher judgement call.

---

<div class="post-metadata">

### Author: ![michael](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/michael/32/11_2.png) [@michael](https://es.discourse.group/u/michael)
#### Post date: [June 25, 2025, 8:33pm UTC](https://es.discourse.group/t/positional-binding-after-rest-binding/2380/5 "2025-06-25T20:33:40Z")

</div>

I think we can learn a lot from the choices and experience of CoffeeScript there. IMO this proposal is very much in the realm of feasible.
