Can someone explain to me why the following is true:
let foo = {
A: [ 1, 2 ]
}
let bar = {
"A": {
"0": "1",
"1": "2"
}
}
assert.deepEqual(foo, bar);
As the documentation says:
Only enumerable "own" properties are considered. The
assert.deepEqual()
implementation does not test the[[Prototype]]
of objects or enumerable ownSymbol
properties. For such checks, consider usingassert.deepStrictEqual()
instead.
The assert.deepStrictEqual()
function does check the prototype too, and
assert.deepStrictEqual(foo, bar);
will return false.