splice conflict
Hello there
I just noticed the following problem
/* without underscore.string */
_([1, 2, 3]).splice(0, 1) // returns [2, 3]
/* with underscore.string */
_([1, 2, 3]).splice(0, 1) // returns ",2,3"
could the splice method be renamed so it does not conflict with Array.splice ?
This is really bad. Will probably fix this later today.
Thanks for the heads up.
Actually, I've just checked. Underscore.string still works fine and doesn't break any of native underscore tests. Also, Underscore does not even have splice method.
So, check your Underscore version, it might be outdated.
I think it can be a problem, because in that case _([1, 2, 3]).splice(0, 1) Underscore delegates splice, reverse and other native functions to the array. http://underscorejs.org/#chaining For ex _([1,2,3]).join('') // => '123'
@edtsech oh, this might be the case. Will investigate today.
@pgherveou how do you attach underscore.string? I couldn't reproduce this issue in the lastest versions of underscore and underscore.string.
_([1, 2, 3]).splice(0, 1) # => [2, 3]
Using node this what i get
> npm ls | grep underscore
├── [email protected]
├── [email protected]
_ = require('underscore');
_.mixin(require('underscore.string').exports());
console.log(_([1, 2, 3]).splice(0, 1));
> ,2,3
@pgherveou ah, ok, I got it. There is not easy way to fix that right now. I might recommend you try to using underscore.string separately as it described in README.