_.isMatch(object, source)
Performs a partial deep comparison between object
and source
to determine if object
contains equivalent property values.Note: This method is equivalent to _.matches
when source
is partially applied.Partial comparisons will match empty array and empty object source
values against any array or object value, respectively. See _.isEqual
for a list of supported value comparisons.
Since
3.0.0
Arguments
object
(Object): The object to inspect.source
(Object): The object of property values to match.
Returns
(boolean): Returns true
if object
is a match, else false
.
Example
var object = { 'a': 1, 'b': 2 };_.isMatch(object, { 'b': 2 });// => true_.isMatch(object, { 'b': 1 });// => false
当前内容版权归 lodash.com 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 lodash.com .