fact-check

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Skill: JavaScript Fact Checker

技能:JavaScript事实核查

Use this skill to verify the technical accuracy of concept documentation pages for the 33 JavaScript Concepts project. This ensures we're not spreading misinformation about JavaScript.
使用此技能来验证33个JavaScript概念项目的概念文档页面的技术准确性,确保我们不会传播关于JavaScript的错误信息。

When to Use

使用场景

  • Before publishing a new concept page
  • After significant edits to existing content
  • When reviewing community contributions
  • When updating pages with new JavaScript features
  • Periodic accuracy audits of existing content
  • 发布新的概念页面之前
  • 对现有内容进行重大编辑之后
  • 审核社区贡献时
  • 使用新的JavaScript功能更新页面时
  • 定期对现有内容进行准确性审核

What We're Protecting Against

我们需要防范的问题

  • Incorrect JavaScript behavior claims
  • Outdated information (pre-ES6 patterns presented as current)
  • Code examples that don't produce stated outputs
  • Broken or misleading external resource links
  • Common misconceptions stated as fact
  • Browser-specific behavior presented as universal
  • Inaccurate API descriptions

  • 关于JavaScript行为的错误声明
  • 过时信息(将ES6之前的模式作为当前内容呈现)
  • 无法产生所述输出的代码示例
  • 失效或具有误导性的外部资源链接
  • 被当作事实的常见误解
  • 被当作通用行为的浏览器特定行为
  • 不准确的API描述

Fact-Checking Methodology

事实核查方法

Follow these five phases in order for a complete fact check.
按顺序遵循以下五个阶段,完成完整的事实核查。

Phase 1: Code Example Verification

第一阶段:代码示例验证

Every code example in the concept page must be verified for accuracy.
概念页面中的每个代码示例都必须经过准确性验证。

Step-by-Step Process

分步流程

  1. Identify all code blocks in the document
  2. For each code block:
    • Read the code and any output comments (e.g.,
      // "string"
      )
    • Mentally execute the code or test in a JavaScript environment
    • Verify the output matches what's stated in comments
    • Check that variable names and logic are correct
  3. For "wrong" examples (marked with ❌):
    • Verify they actually produce the wrong/unexpected behavior
    • Confirm the explanation of why it's wrong is accurate
  4. For "correct" examples (marked with ✓):
    • Verify they work as stated
    • Confirm they follow current best practices
  5. Run project tests:
    bash
    # Run all tests
    npm test
    
    # Run tests for a specific concept
    npm test -- tests/fundamentals/call-stack/
    npm test -- tests/fundamentals/primitive-types/
  6. Check test coverage:
    • Look in
      /tests/{category}/{concept-name}/
    • Verify tests exist for major code examples
    • Flag examples without test coverage
  1. 识别文档中的所有代码块
  2. 对于每个代码块:
    • 阅读代码以及所有输出注释(例如:
      // "string"
    • 在脑海中执行代码或在JavaScript环境中测试
    • 验证输出是否与注释中说明的内容一致
    • 检查变量名称和逻辑是否正确
  3. 对于标记为❌的「错误」示例:
    • 验证它们确实会产生错误/意外行为
    • 确认对其错误原因的解释准确无误
  4. 对于标记为✓的「正确」示例:
    • 验证它们是否按预期工作
    • 确认它们遵循当前的最佳实践
  5. 运行项目测试:
    bash
    # Run all tests
    npm test
    
    # Run tests for a specific concept
    npm test -- tests/fundamentals/call-stack/
    npm test -- tests/fundamentals/primitive-types/
  6. 检查测试覆盖率:
    • 查看
      /tests/{category}/{concept-name}/
      目录
    • 验证主要代码示例都有对应的测试
    • 标记没有测试覆盖的示例

Code Verification Checklist

代码验证检查表

CheckHow to Verify
console.log
outputs match comments
Run code or trace mentally
Variables are correctly named/usedRead through logic
Functions return expected valuesTrace execution
Async code resolves in stated orderUnderstand event loop
Error examples actually throwTest in try/catch
Array/object methods return correct typesCheck MDN
typeof
results are accurate
Test common cases
Strict mode behavior noted if relevantCheck if example depends on it
检查项验证方式
console.log
输出与注释匹配
运行代码或在脑海中推演
变量命名和使用正确通读逻辑
函数返回预期值推演执行过程
异步代码按所述顺序解析理解事件循环
错误示例确实会抛出异常在try/catch中测试
数组/对象方法返回正确类型查阅MDN
typeof
结果准确
测试常见用例
严格模式行为(如相关)已注明检查示例是否依赖严格模式

Common Output Mistakes to Catch

需要注意的常见输出错误

javascript
// Watch for these common mistakes:

// 1. typeof null
typeof null        // "object" (not "null"!)

// 2. Array methods that return new arrays vs mutate
const arr = [1, 2, 3]
arr.push(4)        // Returns 4 (length), not the array!
arr.map(x => x*2)  // Returns NEW array, doesn't mutate

// 3. Promise resolution order
Promise.resolve().then(() => console.log('micro'))
setTimeout(() => console.log('macro'), 0)
console.log('sync')
// Output: sync, micro, macro (NOT sync, macro, micro)

// 4. Comparison results
[] == false        // true
[] === false       // false
![]                // false (empty array is truthy!)

// 5. this binding
const obj = {
  name: 'Alice',
  greet: () => console.log(this.name)  // undefined! Arrow has no this
}

javascript
// Watch for these common mistakes:

// 1. typeof null
typeof null        // "object" (not "null"!)

// 2. Array methods that return new arrays vs mutate
const arr = [1, 2, 3]
arr.push(4)        // Returns 4 (length), not the array!
arr.map(x => x*2)  // Returns NEW array, doesn't mutate

// 3. Promise resolution order
Promise.resolve().then(() => console.log('micro'))
setTimeout(() => console.log('macro'), 0)
console.log('sync')
// Output: sync, micro, macro (NOT sync, macro, micro)

// 4. Comparison results
[] == false        // true
[] === false       // false
![]                // false (empty array is truthy!)

// 5. this binding
const obj = {
  name: 'Alice',
  greet: () => console.log(this.name)  // undefined! Arrow has no this
}

Phase 2: MDN Documentation Verification

第二阶段:MDN文档验证

All claims about JavaScript APIs, methods, and behavior should align with MDN documentation.
所有关于JavaScript API、方法和行为的声明都应与MDN文档保持一致。

Step-by-Step Process

分步流程

  1. Check all MDN links:
    • Click each MDN link in the document
    • Verify the link returns 200 (not 404)
    • Confirm the linked page matches what's being referenced
  2. Verify API descriptions:
    • Compare method signatures with MDN
    • Check parameter names and types
    • Verify return types
    • Confirm edge case behavior
  3. Check for deprecated APIs:
    • Look for deprecation warnings on MDN
    • Flag any deprecated methods being taught as current
  4. Verify browser compatibility claims:
    • Cross-reference with MDN compatibility tables
    • Check Can I Use for broader support data
  1. 检查所有MDN链接:
    • 点击文档中的每个MDN链接
    • 验证链接返回200状态码(而非404)
    • 确认链接指向的页面与引用的内容匹配
  2. 验证API描述:
    • 将方法签名与MDN进行对比
    • 检查参数名称和类型
    • 验证返回类型
    • 确认边缘情况行为
  3. 检查已弃用的API:
    • 在MDN上查找弃用警告
    • 标记任何被当作当前内容教授的已弃用方法
  4. 验证浏览器兼容性声明:
    • 与MDN兼容性表交叉引用
    • 查阅Can I Use获取更全面的支持数据

MDN Link Patterns

MDN链接模式

Content TypeMDN URL Pattern
Web APIs
https://developer.mozilla.org/en-US/docs/Web/API/{APIName}
Global Objects
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/{Object}
Statements
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/{Statement}
Operators
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/{Operator}
HTTP
https://developer.mozilla.org/en-US/docs/Web/HTTP
内容类型MDN URL模式
Web APIs
https://developer.mozilla.org/en-US/docs/Web/API/{APIName}
全局对象
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/{Object}
语句
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/{Statement}
操作符
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/{Operator}
HTTP
https://developer.mozilla.org/en-US/docs/Web/HTTP

What to Verify Against MDN

需要对照MDN验证的内容

Claim TypeWhat to Check
Method signatureParameters, optional params, return type
Return valueExact type and possible values
Side effectsDoes it mutate? What does it affect?
ExceptionsWhat errors can it throw?
Browser supportCompatibility tables
Deprecation statusAny deprecation warnings?

声明类型检查内容
方法签名参数、可选参数、返回类型
返回值精确类型和可能的值
副作用是否会发生突变?会影响什么?
异常可能抛出哪些错误?
浏览器支持兼容性表
弃用状态是否有弃用警告?

Phase 3: ECMAScript Specification Compliance

第三阶段:ECMAScript规范合规性验证

For nuanced JavaScript behavior, verify against the ECMAScript specification.
对于JavaScript的细微行为,需对照ECMAScript规范进行验证。

When to Check the Spec

何时查阅规范

  • Edge cases and unusual behavior
  • Claims about "how JavaScript works internally"
  • Type coercion rules
  • Operator precedence
  • Execution order guarantees
  • Claims using words like "always", "never", "guaranteed"
  • 边缘情况和异常行为
  • 关于「JavaScript内部工作原理」的声明
  • 类型转换规则
  • 操作符优先级
  • 执行顺序保证
  • 使用「总是」、「从不」、「保证」等词汇的声明

How to Navigate the Spec

如何查阅规范

The ECMAScript specification is at: https://tc39.es/ecma262/
ConceptSpec Section
Type coercionAbstract Operations (7.1)
EqualityAbstract Equality Comparison (7.2.14), Strict Equality (7.2.15)
typeofThe typeof Operator (13.5.3)
ObjectsOrdinary and Exotic Objects' Behaviours (10)
FunctionsECMAScript Function Objects (10.2)
this bindingResolveThisBinding (9.4.4)
PromisesPromise Objects (27.2)
IterationIteration (27.1)
ECMAScript规范地址:https://tc39.es/ecma262/
概念规范章节
类型转换抽象操作(7.1)
相等性抽象相等比较(7.2.14)、严格相等(7.2.15)
typeoftypeof操作符(13.5.3)
对象普通对象和奇异对象的行为(10)
函数ECMAScript函数对象(10.2)
this绑定ResolveThisBinding(9.4.4)
PromisePromise对象(27.2)
迭代迭代(27.1)

Spec Verification Examples

规范验证示例

javascript
// Claim: "typeof null returns 'object' due to a bug"
// Spec says: typeof null → "object" (Table 41)
// Historical context: This is a known quirk from JS 1.0
// Verdict: ✓ Correct, though calling it a "bug" is slightly informal

// Claim: "Promises always resolve asynchronously"
// Spec says: Promise reaction jobs are enqueued (27.2.1.3.2)
// Verdict: ✓ Correct - even resolved promises schedule microtasks

// Claim: "=== is faster than =="
// Spec says: Nothing about performance
// Verdict: ⚠️ Needs nuance - this is implementation-dependent

javascript
// Claim: "typeof null returns 'object' due to a bug"
// Spec says: typeof null → "object" (Table 41)
// Historical context: This is a known quirk from JS 1.0
// Verdict: ✓ Correct, though calling it a "bug" is slightly informal

// Claim: "Promises always resolve asynchronously"
// Spec says: Promise reaction jobs are enqueued (27.2.1.3.2)
// Verdict: ✓ Correct - even resolved promises schedule microtasks

// Claim: "=== is faster than =="
// Spec says: Nothing about performance
// Verdict: ⚠️ Needs nuance - this is implementation-dependent

Phase 4: External Resource Verification

第四阶段:外部资源验证

All external links (articles, videos, courses) must be verified.
所有外部链接(文章、视频、课程)都必须经过验证。

Step-by-Step Process

分步流程

  1. Check link accessibility:
    • Click each external link
    • Verify it loads (not 404, not paywalled)
    • Note any redirects to different URLs
  2. Verify content accuracy:
    • Skim the resource for obvious errors
    • Check it's JavaScript-focused (not C#, Python, Java)
    • Verify it's not teaching anti-patterns
  3. Check publication date:
    • For time-sensitive topics (async, modules, etc.), prefer recent content
    • Flag resources from before 2015 for ES6+ topics
  4. Verify description accuracy:
    • Does our description match what the resource actually covers?
    • Is the description specific (not generic)?
  1. 检查链接可访问性:
    • 点击每个外部链接
    • 验证链接可加载(不是404,不是付费墙)
    • 记录任何重定向到不同URL的情况
  2. 验证内容准确性:
    • 略读资源,查找明显错误
    • 检查它是否以JavaScript为重点(而非C#、Python、Java)
    • 验证它没有教授反模式
  3. 检查发布日期:
    • 对于时效性强的主题(异步、模块等),优先选择近期内容
    • 标记2015年之前的ES6+主题相关资源
  4. 验证描述准确性:
    • 我们的描述是否与资源实际涵盖的内容匹配?
    • 描述是否具体(而非泛泛而谈)?

External Resource Checklist

外部资源检查表

CheckPass Criteria
Link worksReturns 200, content loads
Not paywalledFree to access (or clearly marked)
JavaScript-focusedNot primarily about other languages
Not outdatedPost-2015 for modern JS topics
Accurate descriptionOur description matches actual content
No anti-patternsDoesn't teach bad practices
Reputable sourceFrom known/trusted creators
检查项通过标准
链接可用返回200状态码,内容可加载
无付费墙可免费访问(或已明确标记)
以JavaScript为重点不主要涉及其他语言
不过时现代JS主题相关资源为2015年后发布
描述准确我们的描述与实际内容匹配
无反模式不教授不良实践
来源可信来自知名/可信创作者

Red Flags in External Resources

外部资源中的危险信号

  • Uses
    var
    everywhere for ES6+ topics
  • Uses callbacks for content about Promises/async
  • Teaches jQuery as modern DOM manipulation
  • Contains factual errors about JavaScript
  • Video is >2 hours without timestamp links
  • Content is primarily about another language
  • Uses deprecated APIs without noting deprecation

  • 在ES6+主题中到处使用
    var
  • 在关于Promise/async的内容中使用回调
  • 将jQuery作为现代DOM操作方法教授
  • 包含关于JavaScript的事实错误
  • 视频时长超过2小时且没有时间戳链接
  • 内容主要关于其他语言
  • 使用已弃用的API但未注明弃用

Phase 5: Technical Claims Audit

第五阶段:技术声明审核

Review all prose claims about JavaScript behavior.
审查所有关于JavaScript行为的书面声明。

Claims That Need Verification

需要验证的声明类型

Claim TypeHow to Verify
Performance claimsNeed benchmarks or caveats
Browser behaviorSpecify which browsers, check MDN
Historical claimsVerify dates/versions
"Always" or "never" statementsCheck for exceptions
Comparisons (X vs Y)Verify both sides accurately
声明类型验证方式
性能声明需要基准测试或说明限制条件
浏览器行为指定浏览器,查阅MDN
历史声明验证日期/版本
「总是」或「从不」类声明检查是否有例外情况
比较类声明(X vs Y)验证双方描述准确

Red Flags in Technical Claims

技术声明中的危险信号

  • "Always" or "never" without exceptions noted
  • Performance claims without benchmarks
  • Browser behavior claims without specifying browsers
  • Comparisons that oversimplify differences
  • Historical claims without dates
  • Claims about "how JavaScript works" without spec reference
  • 「总是」或「从不」类声明未注明例外情况
  • 无基准测试的性能声明
  • 未指定浏览器的浏览器行为声明
  • 过度简化差异的比较类声明
  • 无日期的历史声明
  • 关于「JavaScript工作原理」的声明未引用规范

Examples of Claims to Verify

需要验证的声明示例

markdown
❌ "async/await is always better than Promises"
→ Verify: Not always - Promise.all() is better for parallel operations

❌ "JavaScript is an interpreted language"
→ Verify: Modern JS engines use JIT compilation

❌ "Objects are passed by reference"
→ Verify: Technically "passed by sharing" - the reference is passed by value

❌ "=== is faster than =="
→ Verify: Implementation-dependent, not guaranteed by spec

✓ "JavaScript is single-threaded"
→ Verify: Correct for the main thread (Web Workers are separate)

✓ "Promises always resolve asynchronously"
→ Verify: Correct per ECMAScript spec

markdown
❌ "async/await is always better than Promises"
→ Verify: Not always - Promise.all() is better for parallel operations

❌ "JavaScript is an interpreted language"
→ Verify: Modern JS engines use JIT compilation

❌ "Objects are passed by reference"
→ Verify: Technically "passed by sharing" - the reference is passed by value

❌ "=== is faster than =="
→ Verify: Implementation-dependent, not guaranteed by spec

✓ "JavaScript is single-threaded"
→ Verify: Correct for the main thread (Web Workers are separate)

✓ "Promises always resolve asynchronously"
→ Verify: Correct per ECMAScript spec

Common JavaScript Misconceptions

常见JavaScript误解

Watch for these misconceptions being stated as fact.
注意不要将这些误解当作事实陈述。

Type System Misconceptions

类型系统误解

MisconceptionRealityHow to Verify
typeof null === "object"
is intentional
It's a bug from JS 1.0 that can't be fixed for compatibilityHistorical context, TC39 discussions
JavaScript has no typesJS is dynamically typed, not untypedECMAScript spec defines types
==
is always wrong
== null
checks both null and undefined, has valid uses
Many style guides allow this pattern
NaN === NaN
is false "by mistake"
It's intentional per IEEE 754 floating point specIEEE 754 standard
误解实际情况验证方式
typeof null === "object"
是有意设计的
这是JS 1.0中的一个已知缺陷,出于兼容性考虑无法修复历史背景、TC39讨论
JavaScript没有类型JS是动态类型语言,而非无类型语言ECMAScript规范定义了类型
==
总是错误的
== null
可同时检查null和undefined,有合理用途
许多风格指南允许此模式
NaN === NaN
为false是「错误」
这是IEEE 754浮点数规范的有意设计IEEE 754标准

Function Misconceptions

函数误解

MisconceptionRealityHow to Verify
Arrow functions are just shorter syntaxThey have no
this
,
arguments
,
super
, or
new.target
MDN, ECMAScript spec
var
is hoisted to function scope with its value
Only declaration is hoisted, not initializationCode test, MDN
Closures are a special opt-in featureAll functions in JS are closuresECMAScript spec
IIFEs are obsoleteStill useful for one-time initializationModern codebases still use them
误解实际情况验证方式
箭头函数只是更短的语法它们没有
this
arguments
super
new.target
MDN、ECMAScript规范
var
会连同其值提升到函数作用域
只有声明会被提升,初始化不会代码测试、MDN
闭包是一种特殊的可选功能JS中的所有函数都是闭包ECMAScript规范
IIFE已过时仍可用于一次性初始化现代代码库仍在使用

Async Misconceptions

异步误解

MisconceptionRealityHow to Verify
Promises run in parallelJS is single-threaded; Promises are async, not parallelEvent loop explanation
async/await
is different from Promises
It's syntactic sugar over PromisesMDN, can await any thenable
setTimeout(fn, 0)
runs immediately
Runs after current execution + microtasksEvent loop, code test
await
pauses the entire program
Only pauses the async function, not the event loopCode test
误解实际情况验证方式
Promise并行运行JS是单线程的;Promise是异步的,而非并行事件循环解释
async/await
与Promise不同
它是Promise的语法糖MDN、可await任何thenable对象
setTimeout(fn, 0)
立即运行
在当前执行栈和微任务之后运行事件循环、代码测试
await
会暂停整个程序
只会暂停异步函数,不会暂停事件循环代码测试

Object Misconceptions

对象误解

MisconceptionRealityHow to Verify
Objects are "passed by reference"References are passed by value ("pass by sharing")Reassignment test
const
makes objects immutable
const
prevents reassignment, not mutation
Code test
Everything in JavaScript is an objectPrimitives are not objects (though they have wrappers)
typeof
tests, MDN
Object.freeze()
creates deep immutability
It's shallow - nested objects can still be mutatedCode test
误解实际情况验证方式
对象是「按引用传递」引用是按值传递的(「按共享传递」)重新赋值测试
const
使对象不可变
const
防止重新赋值,而非突变
代码测试
JavaScript中的所有事物都是对象原始值不是对象(尽管它们有包装对象)
typeof
测试、MDN
Object.freeze()
创建深度不可变性
它是浅层次的 - 嵌套对象仍可被突变代码测试

Performance Misconceptions

性能误解

MisconceptionRealityHow to Verify
===
is always faster than
==
Implementation-dependent, not spec-guaranteedBenchmarks vary
for
loops are faster than
forEach
Modern engines optimize both; depends on use caseBenchmark
Arrow functions are fasterNo performance difference, just different behaviorBenchmark
Avoiding DOM manipulation is always fasterSometimes batch mutations are slower than individualDepends on browser, use case

误解实际情况验证方式
===
总是比
==
取决于实现,规范未保证基准测试结果各异
for
循环比
forEach
现代引擎会对两者进行优化;取决于用例基准测试
箭头函数更快没有性能差异,只是行为不同基准测试
避免DOM操作总是更快有时批量突变比单个突变更慢取决于浏览器和用例

Test Integration

测试集成

Running the project's test suite is a key part of fact-checking.
运行项目的测试套件是事实核查的关键部分。

Test Commands

测试命令

bash
undefined
bash
undefined

Run all tests

Run all tests

npm test
npm test

Run tests in watch mode

Run tests in watch mode

npm run test:watch
npm run test:watch

Run tests with coverage

Run tests with coverage

npm run test:coverage
npm run test:coverage

Run tests for specific concept

Run tests for specific concept

npm test -- tests/fundamentals/call-stack/ npm test -- tests/fundamentals/primitive-types/ npm test -- tests/fundamentals/value-reference-types/ npm test -- tests/fundamentals/type-coercion/ npm test -- tests/fundamentals/equality-operators/ npm test -- tests/fundamentals/scope-and-closures/
undefined
npm test -- tests/fundamentals/call-stack/ npm test -- tests/fundamentals/primitive-types/ npm test -- tests/fundamentals/value-reference-types/ npm test -- tests/fundamentals/type-coercion/ npm test -- tests/fundamentals/equality-operators/ npm test -- tests/fundamentals/scope-and-closures/
undefined

Test Directory Structure

测试目录结构

tests/
├── fundamentals/              # Concepts 1-6
│   ├── call-stack/
│   ├── primitive-types/
│   ├── value-reference-types/
│   ├── type-coercion/
│   ├── equality-operators/
│   └── scope-and-closures/
├── functions-execution/       # Concepts 7-8
│   ├── event-loop/
│   └── iife-modules/
└── web-platform/              # Concepts 9-10
    ├── dom/
    └── http-fetch/
tests/
├── fundamentals/              # Concepts 1-6
│   ├── call-stack/
│   ├── primitive-types/
│   ├── value-reference-types/
│   ├── type-coercion/
│   ├── equality-operators/
│   └── scope-and-closures/
├── functions-execution/       # Concepts 7-8
│   ├── event-loop/
│   └── iife-modules/
└── web-platform/              # Concepts 9-10
    ├── dom/
    └── http-fetch/

When Tests Are Missing

缺少测试时的处理

If a concept doesn't have tests:
  1. Flag this in the report as "needs test coverage"
  2. Manually verify code examples are correct
  3. Consider adding tests as a follow-up task

如果某个概念没有测试:
  1. 在报告中标记为「需要测试覆盖」
  2. 手动验证代码示例是否正确
  3. 考虑将添加测试作为后续任务

Verification Resources

验证资源

Primary Sources

主要来源

ResourceURLUse For
MDN Web Docshttps://developer.mozilla.orgAPI docs, guides, compatibility
ECMAScript Spechttps://tc39.es/ecma262Authoritative behavior
TC39 Proposalshttps://github.com/tc39/proposalsNew features, stages
Can I Usehttps://caniuse.comBrowser compatibility
Node.js Docshttps://nodejs.org/docsNode-specific APIs
V8 Bloghttps://v8.dev/blogEngine internals
资源URL用途
MDN Web Docshttps://developer.mozilla.orgAPI文档、指南、兼容性
ECMAScript Spechttps://tc39.es/ecma262权威行为参考
TC39 Proposalshttps://github.com/tc39/proposals新功能、阶段
Can I Usehttps://caniuse.com浏览器兼容性
Node.js Docshttps://nodejs.org/docsNode专属API
V8 Bloghttps://v8.dev/blog引擎内部原理

Project Resources

项目资源

ResourcePathUse For
Test Suite
/tests/
Verify code examples
Concept Pages
/docs/concepts/
Current content
Run Tests
npm test
Execute all tests

资源路径用途
测试套件
/tests/
验证代码示例
概念页面
/docs/concepts/
当前内容
运行测试
npm test
执行所有测试

Fact Check Report Template

事实核查报告模板

Use this template to document your findings.
markdown
undefined
使用此模板记录你的发现。
markdown
undefined

Fact Check Report: [Concept Name]

Fact Check Report: [Concept Name]

File:
/docs/concepts/[slug].mdx
Date: YYYY-MM-DD Reviewer: [Name/Claude] Overall Status: ✅ Verified | ⚠️ Minor Issues | ❌ Major Issues

File:
/docs/concepts/[slug].mdx
Date: YYYY-MM-DD Reviewer: [Name/Claude] Overall Status: ✅ Verified | ⚠️ Minor Issues | ❌ Major Issues

Executive Summary

Executive Summary

[2-3 sentence summary of findings. State whether the page is accurate overall and highlight any critical issues.]
Tests Run: Yes/No Test Results: X passing, Y failing External Links Checked: X/Y valid

[2-3 sentence summary of findings. State whether the page is accurate overall and highlight any critical issues.]
Tests Run: Yes/No Test Results: X passing, Y failing External Links Checked: X/Y valid

Phase 1: Code Example Verification

Phase 1: Code Example Verification

#DescriptionLineStatusNotes
1[Brief description]XX✅/⚠️/❌[Notes]
2[Brief description]XX✅/⚠️/❌[Notes]
3[Brief description]XX✅/⚠️/❌[Notes]
#DescriptionLineStatusNotes
1[Brief description]XX✅/⚠️/❌[Notes]
2[Brief description]XX✅/⚠️/❌[Notes]
3[Brief description]XX✅/⚠️/❌[Notes]

Code Issues Found

Code Issues Found

Issue 1: [Title]

Issue 1: [Title]

Location: Line XX Severity: Critical/Major/Minor Current Code:
javascript
// The problematic code
Problem: [Explanation of what's wrong] Correct Code:
javascript
// The corrected code

Location: Line XX Severity: Critical/Major/Minor Current Code:
javascript
// The problematic code
Problem: [Explanation of what's wrong] Correct Code:
javascript
// The corrected code

Phase 2: MDN/Specification Verification

Phase 2: MDN/Specification Verification

ClaimLocationSourceStatusNotes
[Claim made]Line XXMDN/Spec✅/⚠️/❌[Notes]
ClaimLocationSourceStatusNotes
[Claim made]Line XXMDN/Spec✅/⚠️/❌[Notes]

MDN Link Status

MDN Link Status

Link TextURLStatus
[Text][URL]✅ 200 / ❌ 404
Link TextURLStatus
[Text][URL]✅ 200 / ❌ 404

Specification Discrepancies

Specification Discrepancies

[If any claims don't match the ECMAScript spec, detail them here]

[If any claims don't match the ECMAScript spec, detail them here]

Phase 3: External Resource Verification

Phase 3: External Resource Verification

ResourceTypeLinkContentNotes
[Title]Article/Video✅/❌✅/⚠️/❌[Notes]
ResourceTypeLinkContentNotes
[Title]Article/Video✅/❌✅/⚠️/❌[Notes]

Broken Links

Broken Links

  1. Line XX: [URL] - 404 Not Found
  2. Line YY: [URL] - Domain expired
  1. Line XX: [URL] - 404 Not Found
  2. Line YY: [URL] - Domain expired

Content Concerns

Content Concerns

  1. [Resource name]: [Concern - e.g., outdated, wrong language, anti-patterns]
  1. [Resource name]: [Concern - e.g., outdated, wrong language, anti-patterns]

Description Accuracy

Description Accuracy

ResourceDescription Accurate?Notes
[Title]✅/❌[Notes]

ResourceDescription Accurate?Notes
[Title]✅/❌[Notes]

Phase 4: Technical Claims Audit

Phase 4: Technical Claims Audit

ClaimLocationVerdictNotes
"[Claim]"Line XX✅/⚠️/❌[Notes]
ClaimLocationVerdictNotes
"[Claim]"Line XX✅/⚠️/❌[Notes]

Claims Needing Revision

Claims Needing Revision

  1. Line XX: "[Current claim]"
    • Issue: [What's wrong]
    • Suggested: "[Revised claim]"

  1. Line XX: "[Current claim]"
    • Issue: [What's wrong]
    • Suggested: "[Revised claim]"

Phase 5: Test Results

Phase 5: Test Results

Test File:
/tests/[category]/[concept]/[concept].test.js
Tests Run: XX Passing: XX Failing: XX
Test File:
/tests/[category]/[concept]/[concept].test.js
Tests Run: XX Passing: XX Failing: XX

Failing Tests

Failing Tests

Test NameExpectedActualRelated Doc Line
[Test][Expected][Actual]Line XX
Test NameExpectedActualRelated Doc Line
[Test][Expected][Actual]Line XX

Coverage Gaps

Coverage Gaps

Examples in documentation without corresponding tests:
  • Line XX: [Description of untested example]
  • Line YY: [Description of untested example]

Examples in documentation without corresponding tests:
  • Line XX: [Description of untested example]
  • Line YY: [Description of untested example]

Issues Summary

Issues Summary

Critical (Must Fix Before Publishing)

Critical (Must Fix Before Publishing)

  1. [Issue title]
    • Location: Line XX
    • Problem: [Description]
    • Fix: [How to fix]
  1. [Issue title]
    • Location: Line XX
    • Problem: [Description]
    • Fix: [How to fix]

Major (Should Fix)

Major (Should Fix)

  1. [Issue title]
    • Location: Line XX
    • Problem: [Description]
    • Fix: [How to fix]
  1. [Issue title]
    • Location: Line XX
    • Problem: [Description]
    • Fix: [How to fix]

Minor (Nice to Have)

Minor (Nice to Have)

  1. [Issue title]
    • Location: Line XX
    • Suggestion: [Improvement]

  1. [Issue title]
    • Location: Line XX
    • Suggestion: [Improvement]

Recommendations

Recommendations

  1. [Priority 1]: [Specific actionable recommendation]
  2. [Priority 2]: [Specific actionable recommendation]
  3. [Priority 3]: [Specific actionable recommendation]

  1. [Priority 1]: [Specific actionable recommendation]
  2. [Priority 2]: [Specific actionable recommendation]
  3. [Priority 3]: [Specific actionable recommendation]

Verification Checklist

Verification Checklist

  • All code examples verified for correct output
  • All MDN links checked and valid
  • API descriptions match MDN documentation
  • ECMAScript compliance verified (if applicable)
  • All external resource links accessible
  • Resource descriptions accurately represent content
  • No common JavaScript misconceptions found
  • Technical claims are accurate and nuanced
  • Project tests run and reviewed
  • Report complete and ready for handoff

  • All code examples verified for correct output
  • All MDN links checked and valid
  • API descriptions match MDN documentation
  • ECMAScript compliance verified (if applicable)
  • All external resource links accessible
  • Resource descriptions accurately represent content
  • No common JavaScript misconceptions found
  • Technical claims are accurate and nuanced
  • Project tests run and reviewed
  • Report complete and ready for handoff

Sign-off

Sign-off

Verified by: [Name/Claude] Date: YYYY-MM-DD Recommendation: ✅ Ready to publish | ⚠️ Fix issues first | ❌ Major revision needed

---
Verified by: [Name/Claude] Date: YYYY-MM-DD Recommendation: ✅ Ready to publish | ⚠️ Fix issues first | ❌ Major revision needed

---

Quick Reference: Verification Commands

快速参考:验证命令

bash
undefined
bash
undefined

Run all tests

Run all tests

npm test
npm test

Run specific concept tests

Run specific concept tests

npm test -- tests/fundamentals/call-stack/
npm test -- tests/fundamentals/call-stack/

Check for broken links (if you have a link checker)

Check for broken links (if you have a link checker)

Install: npm install -g broken-link-checker

Install: npm install -g broken-link-checker

Quick JavaScript REPL for testing

Quick JavaScript REPL for testing

node
typeof null 'object' [1,2,3].map(x => x * 2) [ 2, 4, 6 ]

---
node
typeof null 'object' [1,2,3].map(x => x * 2) [ 2, 4, 6 ]

---

Summary

总结

When fact-checking a concept page:
  1. Run tests first
    npm test
    catches code errors automatically
  2. Verify every code example — Output comments must match reality
  3. Check all MDN links — Broken links and incorrect descriptions hurt credibility
  4. Verify external resources — Must be accessible, accurate, and JavaScript-focused
  5. Audit technical claims — Watch for misconceptions and unsupported statements
  6. Document everything — Use the report template for consistent, thorough reviews
Remember: Our readers trust us to teach them correct JavaScript. A single piece of misinformation can create confusion that takes years to unlearn. Take fact-checking seriously.
对概念页面进行事实核查时:
  1. 先运行测试
    npm test
    会自动捕获代码错误
  2. 验证每个代码示例 — 输出注释必须与实际结果一致
  3. 检查所有MDN链接 — 失效链接和不准确的描述会损害可信度
  4. 验证外部资源 — 必须可访问、准确且以JavaScript为重点
  5. 审核技术声明 — 注意误解和无依据的陈述
  6. 记录所有内容 — 使用报告模板进行一致、全面的审查
请记住: 我们的读者信任我们,期望我们教授正确的JavaScript知识。一条错误信息可能会造成多年难以纠正的混淆。请认真对待事实核查工作。