Underscore 互动版

比较

_.isEqual(object, other)

执行两个对象之间的优化深度比较,确定他们是否应被视为相等

    var stooge = {name: 'moe', luckyNumbers: [13, 27, 34]};
    var clone  = {name: 'moe', luckyNumbers: [13, 27, 34]};
    stooge == clone;
    => false
    _.isEqual(stooge, clone);
    => true
将上文中的示例,在右侧javascript代码框中实现。