dtao / lazy.js

Like Underscore, but lazier

Home Page:http://danieltao.com/lazy.js/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

join ignores non-string delimiter

excessivelyrigorous opened this issue · comments

Example:
_.join([0,0], 0) == "000"
Lazy([0,0]).join(0) == "0,0"

In this example I would say that Lazy is silently "overruling" my request of using a non-string delimiter -- which I think is bad.

Also, I assume that it is preferable in general that Lazy behaves equivalently to lodash when the function names are equal, which is not the case here.

Without having looked at the code, my suspicion is this could be a bug with treating a falsey value as non-existent. What if you specify 1 as the delimiter instead of 0?

Yes that seems possible from my example.

But:

Lazy([0,0]).join(1); // 0,0
Lazy([1,2]).join(true); // 1,2

Good find!