Skip to content

Instantly share code, notes, and snippets.

View imadbz's full-sized avatar

Imad Bouziani imadbz

View GitHub Profile
@imadbz
imadbz / 1_primitive_comparison.js
Last active February 18, 2019 21:18 — forked from nicbell/1_primitive_comparison.js
Dropin replacement for '===' that supports deep objects compare. JavaScript object deep comparison.Comparing x === y, where x and y are values, return true or false. Comparing x === y, where x and y are objects, returns true if x and y refer to the same object. Otherwise, returns false even if the objects appear identical.Here is a solution to c…
//Primitive Type Comparison
var a = 1;
var b = 1;
var c = a;
console.log(a == b); //true
console.log(a === b); //true
console.log(a == c); //true
console.log(a === c); //true