>> * You can have default parameters before parameters without defaults.
> The spec explicitly states that any parameter without a default, but after
> another parameter that does have a default assignment implicitly has a
> default property of undefined
As an aside: This can be useful. For example:
```js
function getRandomInteger(lower = 0, upper) {
return Math.floor(Math.random() * (upper - lower)) + lower;
}
```
Implementing this function in some other manner is much more complicated.
But I agree that you want to name parameters if there are more than 2.
--
Dr. Axel Rauschmayer
[email protected]
home: rauschma.de
twitter: twitter.com/rauschma
blog: 2ality.com
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss