This is very cool.
Ronald J Kimball
21
This has been fixed in the gists.
When passed array is [] then head === undefined and tail is an empty array, and we should handle that… a !head check isn’t specific enough although I liked its terseness, there isn’t a nicer way to check other than head === undefined && !tail.length or tail.length === 0. It’s always good to be reminded that JavaScript always know better than you, it keeps us sharp.
Thanks for pointing this out and the kind words :)
Hugo