3 ms·
Nice… I had been using '__', but it seems like this will allow you to use it multiple times in a parameter list.
by kaonashi 13y ago
Nice… I had been using '__', but it seems like this will allow you to use it multiple times in a parameter list.
- couchand 13y agoIt's even cooler than throwaway names [0]. You can index from the back: arr = [1, 2, 3] [..., two, three] = arr or look for node-style callbacks... myFun = (..., cb) -> cb() But you can't use it multiple times. That would allow for ambiguous syntax: # disallowed [..., whatAmI, ...] = [1, 2, 3, 4] [0] https://gist.github.com/aseemk/8637896#expansion-in-array-destructuring https://gist.github.com/aseemk/8637896#expansion-in-array-de...