nodejs 里 Type tags 指的是什么?

nodejs 这个接口里有句话不是明白,请大神解惑。
[assert.deepStrictEqual(actual, expected[, message])](https://nodejs.org/dist/lates...
这里有句话说:

Type tags of objects should be the same.

那问题来了,Type tags 是什么意思?
它文档里举了个例子, 说这2个对象不一样,是因为 type tags 不一样:

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 {}

我理解的 type tagstypeof date 返回的值,但是 typeof datetypeof fakeDate 结果都是 object ,所以我不明白 type tags 指的是什么?

阅读 962
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题