Skip to content

Instantly share code, notes, and snippets.

View garyvh2's full-sized avatar
🎨
β€œWe don't make mistakes, just happy little accidents.” ― Bob Ross

Gary garyvh2

🎨
β€œWe don't make mistakes, just happy little accidents.” ― Bob Ross
  • N/A
  • San Jose, Costa Rica
View GitHub Profile
@garyvh2
garyvh2 / deep-compare.js
Last active December 7, 2018 19:55
Deep Compare between Object and Array using 'every' and 'Object.is'
/**
* Deep Compare
* @param { * } value first entry value
* @param { * } other second entry value
* @param { Boolean } sorted Sort any array before deep comparison
*/
export const deepCompare = (value, other, sorted) => {
/**
* Compare possible primitives
* Object.is works like `===` but additionally differes positive from negative values
@garyvh2
garyvh2 / comparison.md
Created October 22, 2018 22:56
Deep Compare between Object and Array using 'every' and 'Object.is'

Size

lodash.isequal

BUNDLE SIZE

10.1kB

MINIFIED

3.7kB

Deep Compare

BUNDLE SIZE

880 Bytes