title: Compare two array of object to its value, unit test
body: <p>Suppose I have two similar array, how can I write unittest to check if these array has the same values.  And these values are equal. I use mocha and enzyme for unit testing. What is the best way to compare this value?</p>
  
  <pre><code>const devices = [{
          deviceType: 'Tag',
          deviceId: 1,
          name: 'Tag For Sending and alarm',
          version: '',
          location: 'Room1',
          lastAliveMessage: '',
          deviceStatus: 'Active',
          actions: 'offline',
  
      },{
          deviceType: 'Tag1',
          deviceId: 2,
          name: 'Tag For Sending and alarm2 ',
          version: '',
          location: 'Room2',
          lastAliveMessage: '',
          deviceStatus: 'Active',
          actions: 'offline',
      }]
  
  const devices2 = [{
          deviceType: 'Tag',
          deviceId: 1,
          name: 'Tag For Sending and alarm',
          version: '',
          location: 'Room1',
          lastAliveMessage: '',
          deviceStatus: 'Active',
          actions: 'offline',
  
      },{
          deviceType: 'Tag1',
          deviceId: 2,
          name: 'Tag For Sending and alarm2 ',
          version: '',
          location: 'Room2',
          lastAliveMessage: '',
          deviceStatus: 'Active',
          actions: 'offline',
      }]
  
   data.forEach(item =&gt; {
                  devices.forEach(device =&gt;{
  item.deviceId.should.be.equal(device.deviceId))
                  })
              })
  </code></pre>