Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save eugenserbanescu/815a5863ae94109c2866f31bfb27cd20 to your computer and use it in GitHub Desktop.
Save eugenserbanescu/815a5863ae94109c2866f31bfb27cd20 to your computer and use it in GitHub Desktop.
reference equality
function compare(a,b) {
return a == b;
}
function compareStrict(a,b) {
return a === b;
}
let a = {a:1}
compare(a,a) // true
compareStrict(a,a) // true
compare(a,{a:1}) // false
compareStrict(a,{a:1}) // false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment