there is a sentence in the API nodejs that is not clear. Please answer the question.
[assert.deepStrictEqual (actual, expected [, message]] ( https://nodejs.org/dist/lates.
there is a saying:
Type tags of objects should be the same.
that"s the question. What does Type tags
mean?
its document gives an example, saying that the two objects are different because type tags
is different:
const date = new Date();
const fakeDate = {};
Object.setPrototypeOf(fakeDate, Date.prototype);
// Different type tags:
assert.deepStrictEqual(date, fakeDate);
// AssertionError: Input A expected to strictly deep-equal input B:
// + expected - actual
// - 2018-04-26T00:49:08.604Z
// + Date {}
I understand that type tags
is the value returned by typeof date
, but the results of typeof date
and typeof fakeDate
are both object
, so I don"t understand what type tags
means?