0

Why it returns false?

let a = new Object()
let b = Object()
console.log(a) // {}
console.log(b) // {}
console.log(a===b) // false

I checked a proto of a and b too and it is the same.

So what is the difference?j

Machavity
  • 29,816
  • 26
  • 86
  • 96
Luke
  • 307
  • 1
  • 4
  • 17

1 Answers1

1

Instance of objects are not the same even:

let a = new Object();
let b = new Object();
console.log(a===b) // false
Vayrex
  • 1,317
  • 1
  • 10
  • 13