Skip to content

Instantly share code, notes, and snippets.

@vinbarnes
Created June 2, 2015 01:39
Show Gist options
  • Save vinbarnes/43ff31f41c15aa7137ea to your computer and use it in GitHub Desktop.
Save vinbarnes/43ff31f41c15aa7137ea to your computer and use it in GitHub Desktop.
> exp = {data: [{type: 'conversations', id: 28, attributes: { title: "hi" }}, {type: 'conversations', id: 29, attributes: { title: "bye" }}]}
Object { data: Array[2] }
> act = {data: [{type: 'conversations', id: 29, attributes: { title: "bye" }}, {type: 'conversations', id: 28, attributes: { title: "hi" }}]}
Object { data: Array[2] }
> exp == act
false
> exp === act
false
@mwise
Copy link

mwise commented Jun 2, 2015

Yeah for that you would need a whole extra line:

var _ = require('lodash')
_.isEmpty(_.difference(exp, act))

Zing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment