Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Having the meaning of the first argument change because you passed an optional second argument is very odd.

Is it, though?

And yes, I would totally just make it so the function detects whether I am passing in an object or an array of objects and respond accordingly.

I feel like I got this pattern from jQuery or something. Seems very normal for a good library.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: