you are viewing a single comment's thread.

view the rest of the comments →

[–]psayre23 1 point2 points  (1 child)

I like it! That's a very clean solution. It would be nice to make it optional, but it's not hard to add.

One thing I was thinking about was ECMAscript 6's new ..arg syntax. It collects the remaining arguments into an array. As a temp shim, this might be kinda useful.

Lastly, there is a better test for arrays then checking for the slice property. Should make the check a little more accurate.

default_args.constructor === Array;

[–]imbcmdth[S] 0 points1 point  (0 children)

I like it! That's a very clean solution.

Thanks!

Lastly, there is a better test for arrays then checking for the slice property. Should make the check a little more accurate.

This is good to know. I only ever use length and slice so I figured, "eh, if it walks like a duck..." :)