Buffer
is an object
Equality is one of the most initially confusing aspects of JavaScript.
The behavior of == versus ===, the order of type coercions, etc. all serve to complicate the subject.
You might suppose that if two objects have the same properties and all of their properties have the same value, they would be considered equal.
Internally JavaScript actually has two different approaches for testing equality. Primitives like strings and numbers are compared by their value, while objects like arrays, dates, and plain objects are compared by their reference. That comparison by reference basically checks to see if the objects given refer to the same location in memory.
For example:
[ 1 , 2 , 3 ] != [ 1 , 2 , 3 ]
Read more here http://designpepper.com/blog/drips/object-equality-in-javascript.html
How to compare buffers:
Buffer comparison in Node.js