Continuing woes in reading the ES6 spec language

Axel Rauschmayer axel at
Fri Sep 13 15:06:48 PDT 2013

>> * 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:

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
axel at


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list