这里的节点输出是什么

What is the node repl outputting here?

本文关键字:是什么 输出 节点 这里      更新时间:2023-09-26

所有这些属性是什么?它们是属性还是方法还是什么?它们看起来像标签。super_,失败,等于(等于什么?),深度平等,它们是什么意思?您如何访问这些属性|方法|无论它们叫什么?它们是否特定于节点?

// $ node #start the node repl 
// > assert //outputs the below
{ [Function: ok]
  AssertionError: 
   { [Function: AssertionError]
     super_: 
      { [Function: Error]
        captureStackTrace: [Function: captureStackTrace],
        stackTraceLimit: 10 } },
  fail: [Function: fail],
  ok: [Circular],
  equal: [Function: equal],
  notEqual: [Function: notEqual],
  deepEqual: [Function: deepEqual],
  notDeepEqual: [Function: notDeepEqual],
  strictEqual: [Function: strictEqual],
  notStrictEqual: [Function: notStrictEqual],
  throws: [Function],
  doesNotThrow: [Function],
  ifError: [Function] }
它们是

Node assert模块的属性和方法:http://nodejs.org/api/assert.html