lodash array methods work but not string or math methods

146 views Asked by At

I have played lodash in plunker and found a strange issue: the array methods works but not string or math methods. These work:

_.first([1, 2, 3]);
_.isObject(v);

But these do not work:

 _.min([4, 2, 8, 6]);
 _.endsWith('abc', 'c');

Please help me figure it out. Here is the plunker demo. It is forked from a lodash demo.

1

There are 1 answers

0
Mike On BEST ANSWER

You're using an old version of lodash. Your _.min call is working fine (try just running var v = _.min([4, 2, 8, 6]);). _.endsWith isn't working because it doesn't exist in the version of lodash that you're using.