# Why are still no named arguments passed?

**URL:** <https://es.discourse.group/t/why-are-still-no-named-arguments-passed/305>\
**Category:** 💡 Ideas\
**Created:** [April 15, 2020, 3:31pm UTC](https://es.discourse.group/t/why-are-still-no-named-arguments-passed/305 "2020-04-15T15:31:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bsld](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/bsld/32/288_2.png) [@bsld](https://es.discourse.group/u/bsld)\
**Post date:** [April 15, 2020, 3:31pm UTC](https://es.discourse.group/t/why-are-still-no-named-arguments-passed/305/1 "2020-04-15T15:31:58Z")

</div>

I've some function with a large amount of parameters - some of them optional.

My suggestion - allow named parameters like this:

`f(arg0: "hello", arg4:[0, 4], /*arg5*/ 5)`

The just of it is using the same syntax for object literals plus the extension that a following argument can be passed directly occupying the next parameter spot.

I'm also interested what are the steps to rise this proposal to the right place so it could eventually get accepted?

I've looked at this non-intuitive solution [here](https://es.discourse.group/t/optional-named-parameters/198). And also at this proposal [here](https://github.com/samuelgoto/proposal-named-parameters).

Why nothing has budged yet?

---

<div class="post-metadata">

**Author:** ![bergus](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/bergus/32/152_2.png) [@bergus](https://es.discourse.group/u/bergus)\
**Post date:** [April 15, 2020, 4:28pm UTC](https://es.discourse.group/t/why-are-still-no-named-arguments-passed/305/2 "2020-04-15T16:28:19Z")

</div>

> [@bsld](#):
>
> Why nothing has budged yet?

I'd guess that's because passing around options objects is a good-enough solution already.

---

<div class="post-metadata">

**Author:** ![bsld](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/bsld/32/288_2.png) [@bsld](https://es.discourse.group/u/bsld)\
**Post date:** [April 16, 2020, 10:25am UTC](https://es.discourse.group/t/why-are-still-no-named-arguments-passed/305/3 "2020-04-16T10:25:33Z")

</div>

Well for one the other syntax is ugly. Furthermore you can't mix ordered arguments with it.

---

<div class="post-metadata">

**Author:** ![lars-t-hansen](https://avatars.discourse-cdn.com/v4/letter/l/5fc32e/32.png) [@lars-t-hansen](https://es.discourse.group/u/lars-t-hansen)\
**Post date:** [April 17, 2020, 4:06pm UTC](https://es.discourse.group/t/why-are-still-no-named-arguments-passed/305/4 "2020-04-17T16:06:47Z")

</div>

I don't know what's not to like about this, which seems to do both positional and named arguments and default values for all of them:

```javascript
function f(a,b,c,{d='3',e='4',f='5',g='6'}={}) {
  return a + b + c + d + e + f + g
}
f('0','1','2',{f:'hi'}) => "01234hi6"
f('0','1','2') => "0123456"

```

---

<div class="post-metadata">

**Author:** ![bsld](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/bsld/32/288_2.png) [@bsld](https://es.discourse.group/u/bsld)\
**Post date:** [April 17, 2020, 4:42pm UTC](https://es.discourse.group/t/why-are-still-no-named-arguments-passed/305/5 "2020-04-17T16:42:07Z")

</div>

You have to specify the named arguments by their identifiers and the ordered by their order - you can't do for example:

`f('0','1','2',{f:'hi', '7'})`

to specify the g argument.

Additionally the curly braces are ugly.

I don't see a reason not to include my proposed shorthand except by true stubbornness.
