npm install fast-deep-equal
var equal = require('fast-deep-equal');
console.log(equal({foo: 'bar'}, {foo: 'bar'})); // true
//支持es6 map set 类型化素组
var equal = require('fast-deep-equal/es6');
console.log(equal(Int16Array([1, 2]), Int16Array([1, 2]))); // true
//搭配react使用
var equal = require('fast-deep-equal/react');
var equal = require('fast-deep-equal/es6/react');