How do I use the includes method in lodash to check if an object is in the collection?
lodash lets me check for membership of basic data types with includes : _.includes([1, 2, 3], 2) > true But the following doesn't work: _.includes([{"a": 1}, {"b": 2}], {"b": 2}) > false This confuses me because the following methods that search through a collection seem to do just fine: _.where([{"a": 1}, {"b": 2}], {"b": 2}) > {"b": 2} _.find([{"a": 1}, {"b": 2}], {"b": 2}) > {"b": 2} What am I doing wrong? How do I check for the membership of an object in a collection with includes ? edit: question was originally for for lodash version 2.4.1, updated for lodash 4.0.0 p.s.w.g The includes