Since, as I understand it, these are evaluated as successive assignment to the successive lvalues the author could adopt a practice like repeatedly assigning to the variable _.
I am not sure that will work in const statements, though. Dominic On Tue, Sep 27, 2011 at 6:47 AM, Xavier MONTILLET <[email protected]>wrote: > Normally, you use an object for optional arguments. > > And there is no good reason not to since you don't care about the order of > the arguments. > > Sent from my smartphone. > On Sep 26, 2011 11:35 PM, "Sean Eagan" <[email protected]> wrote: > > Most aspects of destructuring are supported in parameter lists: > > > > * rest parameters > > * destructuring of individual parameters > > > > However, there is at least one aspect which is not, which is > > uninteresting parameters : > > > > [x, , z] = arr; > > > > which for parameter lists would look like: > > > > function(x, , z) {...} > > > > This could be useful when you are a defining a callback which needs to > > match a certain signature, but you only care about a certain subset of > > the arguments not at the beginning. For example: > > > > function evens(arr) { > > arr.filter(function(,index) {return index % 2}); > > } > > > > However, I admit it can look strange especially when the uninteresting > > parameter is at the beginning as in the above example. > > > > Thanks, > > Sean Eagan > > _______________________________________________ > > es-discuss mailing list > > [email protected] > > https://mail.mozilla.org/listinfo/es-discuss > > _______________________________________________ > es-discuss mailing list > [email protected] > https://mail.mozilla.org/listinfo/es-discuss > >
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

