Проверка технической точности страниц JavaScript: примеры кода, соответствие MDN/ECMAScript, ссылки.

Звёзды66 532
Авторleonardomso
Установок335

Установка

SKILL.md

Skill: JavaScript Fact Checker

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.

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

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

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:

    # 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

Code Verification Checklist

CheckHow to Verify
console.log outputs match commentsRun 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 accurateTest common cases
Strict mode behavior noted if relevantCheck if example depends on it

Common Output Mistakes to Catch

// 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

All claims about JavaScript APIs, methods, and behavior should align with MDN documentation.

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

MDN Link Patterns

Content TypeMDN URL Pattern
Web APIshttps://developer.mozilla.org/en-US/docs/Web/API/{APIName}
Global Objectshttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/{Object}
Statementshttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/{Statement}
Operatorshttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/{Operator}
HTTPhttps://developer.mozilla.org/en-US/docs/Web/HTTP

What to Verify Against 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

For nuanced JavaScript behavior, verify against the ECMAScript specification.

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"

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)

Spec Verification Examples

// 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)?

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

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

Phase 5: Technical Claims Audit

Review all prose claims about JavaScript behavior.

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

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

Examples of Claims to Verify

❌ "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

Watch for these misconceptions being stated as fact.

Type System Misconceptions

MisconceptionRealityHow to Verify
typeof null === "object" is intentionalIt'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 usesMany style guides allow this pattern
NaN === NaN is false "by mistake"It's intentional per IEEE 754 floating point specIEEE 754 standard

Function Misconceptions

MisconceptionRealityHow to Verify
Arrow functions are just shorter syntaxThey have no this, arguments, super, or new.targetMDN, ECMAScript spec
var is hoisted to function scope with its valueOnly 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

Async Misconceptions

MisconceptionRealityHow to Verify
Promises run in parallelJS is single-threaded; Promises are async, not parallelEvent loop explanation
async/await is different from PromisesIt's syntactic sugar over PromisesMDN, can await any thenable
setTimeout(fn, 0) runs immediatelyRuns after current execution + microtasksEvent loop, code test
await pauses the entire programOnly pauses the async function, not the event loopCode test

Object Misconceptions

MisconceptionRealityHow to Verify
Objects are "passed by reference"References are passed by value ("pass by sharing")Reassignment test
const makes objects immutableconst prevents reassignment, not mutationCode test
Everything in JavaScript is an objectPrimitives are not objects (though they have wrappers)typeof tests, MDN
Object.freeze() creates deep immutabilityIt's shallow - nested objects can still be mutatedCode test

Performance Misconceptions

MisconceptionRealityHow to Verify
=== is always faster than ==Implementation-dependent, not spec-guaranteedBenchmarks vary
for loops are faster than forEachModern 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

Test Integration

Running the project's test suite is a key part of fact-checking.

Test Commands

# Run all tests
npm test

# Run tests in watch mode
npm run test:watch

# Run tests with coverage
npm run test:coverage

# 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/

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/

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

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

Project Resources

ResourcePathUse For
Test Suite/tests/Verify code examples
Concept Pages/docs/concepts/Current content
Run Testsnpm testExecute all tests

Fact Check Report Template

Use this template to document your findings.

# Fact Check Report: [Concept Name]

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

---

## 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

---

## Phase 1: Code Example Verification

| # | Description | Line | Status | Notes |
|---|-------------|------|--------|-------|
| 1 | [Brief description] | XX | ✅/⚠️/❌ | [Notes] |
| 2 | [Brief description] | XX | ✅/⚠️/❌ | [Notes] |
| 3 | [Brief description] | XX | ✅/⚠️/❌ | [Notes] |

### Code Issues Found

#### Issue 1: [Title]

**Location:** Line XX
**Severity:** Critical/Major/Minor
**Current Code:**
```javascript
// The problematic code

Problem: [Explanation of what's wrong] Correct Code:

// The corrected code

Phase 2: MDN/Specification Verification

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

MDN Link Status

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

Specification Discrepancies

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


Phase 3: External Resource Verification

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

Broken Links

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

Content Concerns

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

Description Accuracy

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

Phase 4: Technical Claims Audit

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

Claims Needing Revision

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

Phase 5: Test Results

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

Failing Tests

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

Coverage Gaps

Examples in documentation without corresponding tests:

  • <!-- -->Line XX: [Description of untested example]
  • <!-- -->Line YY: [Description of untested example]

Issues Summary

Critical (Must Fix Before Publishing)

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

Major (Should Fix)

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

Minor (Nice to Have)

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

Recommendations

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

Verification Checklist

  • <!-- -->All code examples verified for correct output
  • <!-- -->Все ссылки MDN проверены и действительны
  • <!-- -->Описания API соответствуют документации MDN
  • <!-- -->Соответствие ECMAScript проверено (если применимо)
  • <!-- -->Все ссылки на внешние ресурсы доступны
  • <!-- -->Описания ресурсов точно отражают их содержимое
  • <!-- -->Распространённых заблуждений о JavaScript не обнаружено
  • <!-- -->Технические утверждения точны и учитывают нюансы
  • <!-- -->Тесты проекта запущены и проверены
  • <!-- -->Отчёт завершён и готов к передаче

Утверждение

Проверил(а): [Имя/Claude] Дата: YYYY-MM-DD Рекомендация: ✅ Готово к публикации | ⚠️ Сначала исправьте проблемы | ❌ Требуется серьёзная доработка


---

## Quick Reference: Verification Commands

```bash
# Run all tests
npm test

# Run specific concept tests
npm test -- tests/fundamentals/call-stack/

# Check for broken links (if you have a link checker)
# Install: npm install -g broken-link-checker
# Run: blc https://developer.mozilla.org/... -ro

# Quick JavaScript REPL for testing
node
> typeof null
'object'
> [1,2,3].map(x => x * 2)
[ 2, 4, 6 ]

Резюме

При проверке фактов на странице концепции:

  1. Сначала запустите тесты — npm test — автоматически выявляет ошибки в коде
  2. Проверьте каждый пример кода — комментарии в выводе должны соответствовать реальности
  3. Проверьте все ссылки MDN — битые ссылки и неверные описания подрывают доверие
  4. Проверьте внешние ресурсы — они должны быть доступны, точны и посвящены JavaScript
  5. Проверьте технические утверждения — следите за заблуждениями и необоснованными заявлениями
  6. Документируйте всё — используйте шаблон отчёта для последовательных и тщательных проверок

Помните: Наши читатели доверяют нам в изучении правильного JavaScript. Одна крупица дезинформации может создать путаницу, на исправление которой уйдут годы. Относитесь к проверке фактов серьёзно.

Вставить в README

Ссылка на карточку для вашего README — без картинок и счётчиков.

[DarkPlay: fact-check](https://darkplay.ru/ai/skills/leonardomso-33-js-concepts-fact-check)

Описание

Проверяет техническую точность страниц о концепциях JavaScript, сверяя примеры кода, соответствие MDN/ECMAScript и внешние ресурсы, чтобы предотвратить дезинформацию.

Похожие скиллы и другие разделы каталога

Популярное в разделе «Скиллы»

Самые востребованные скиллов раздела по установкам и звёздам.

find-skillsvercel-labs · Помогает находить и устанавливать навыки агентов по запросам вроде «как сделать X»…
4 400 000 устан.
grill-memattpocock · Настойчивое интервью для доработки плана или дизайна.
1 600 000 устан.
hyperframesheygen-com · Обязательная точка входа для любых задач по видео, анимации и motion-графике в…
1 600 000 устан.
hyperframes-cliheygen-com · Цикл разработки HyperFrames CLI: init, add, render, preview, publish и другие команды.
1 600 000 устан.
agent-browservercel-labs · CLI для автоматизации браузера для ИИ-агентов: навигация по страницам, заполнение форм…
1 600 000 устан.
media-useheygen-com · Agent Media OS: единый навык для медиа в HyperFrames — BGM, SFX, изображения, голос, LUT.
1 500 000 устан.
hyperframes-registryheygen-com · Установка и подключение блоков реестра в композиции HyperFrames через add и catalog.
1 400 000 устан.
grill-with-docsmattpocock · Настойчивое интервью для доработки плана или дизайна, попутно создающее документацию (ADR…
1 300 000 устан.
improve-codebase-architecturemattpocock · Поиск в кодовой базе возможностей для углубления, визуальный HTML-отчёт о них и детальный…
1 300 000 устан.
tddmattpocock · Разработка через тестирование (TDD): red-green-refactor и интеграционные тесты.
1 300 000 устан.
Похожее в других разделах каталога

Соседние разделы каталога: возможно, нужный инструмент живёт там.

Architectaffaan-m · Специалист по архитектуре ПО для проектирования систем, масштабируемости и принятия…
225 587 ★
E2e Runneraffaan-m · Специалист по E2E-тестам на Vercel Agent Browser и Playwright: генерация, запуск и…
225 587 ★
Planneraffaan-m · Специалист по планированию сложных функций, архитектурных изменений и рефакторинга.
225 587 ★
Refactor Cleaneraffaan-m · Удаляет мёртвый код и дубликаты с помощью knip, depcheck и ts-prune.
225 587 ★
Rust Build Resolveraffaan-m · Специалист по ошибкам сборки Rust: cargo, borrow checker и Cargo.toml.
225 587 ★
Tdd Guideaffaan-m · Специалист по TDD: сначала тесты, покрытие 80%+.
225 587 ★
example-skillsanthropics · Набор примеров навыков, демонстрирующих разные возможности: создание навыков, разработку…
17 комп.
Ponytail — Lazy Senior Dev PersonaDietrichGebert · Персона «ленивого сеньора» как процедура решений: лестница от YAGNI до минимального кода.
72 646 ★
airwallex-agentosanthropics · Глобальная финансовая инфраструктура Airwallex в Claude. Управляйте действиями по счёту…
100 комп.
canvaanthropics · Создание, редактирование, ревью, изменение размера и проверка бренда дизайнов Canva с…
100 комп.

Лучшие ИИ-инструменты для программирования

ИИ для программирования

Подборка нейросетей и ИИ-ассистентов для разработки и автоматизации кода. Сервисы, которые ускоряют написание, ревью и отладку, экономят часы рутины и снижают порог входа в сложные

GenAPIGenapi
По запросу
5.0
Notepad++ AINotepad-plus-plus
По запросу
4.9
GitHub CopilotGitHub
По подписке
4.9
Creatium MaxCremax
По запросу
4.8
Emacs AIGnu
По запросу
4.8
KiteKite
По запросу
4.8
Amazon Q DeveloperAmazon
По запросу
4.8
VECTA
Есть бесплатный тариф
4.8
SoftPractice
Есть бесплатный тариф
4.8
VibeForge
Есть бесплатный тариф
4.7

Лучшие ИИ-инструменты для генерации видео

Генерация видео

Подборка нейросетей для генерации и монтажа видео. Инструменты, которые превращают текст в готовые ролики, экономят часы на съемках и постпродакшне. Подходит для SMM-специалистов,

VEED.IOVeed
По запросу
5.0
MootionMootion
По запросу
5.0
FlyviFlyvi
Есть бесплатный тариф
4.9
Google Veo 3.1Google
Платно
4.9
Sora (OpenAI)OpenAI
Платно
4.9
PikaPika
Платно
4.9
captions space
Есть бесплатный тариф
4.8
Клайп
Есть бесплатный тариф
4.8
viralpulse.appViralpulse
По запросу
4.8
Viral Maker AIViral-maker
Есть бесплатный тариф
4.8

Лучшие ИИ-инструменты для генерации текста и копирайтинга

Генерация текста и копирайтинг

Подборка нейросетей для генерации текстов и копирайтинга. Сервисы, которые помогают создавать статьи, посты и рекламные объявления с нуля или по черновику, экономя часы рутинной ра

NeuroscribeNeuroscribe
Есть бесплатный тариф
5.0
GoGPTGogpt
По запросу
5.0
ChatsonicChatsonic
По запросу
4.9
НейроТекстерNeuro-texter
По запросу
4.9
ChatGPTOpenAI
По подписке
4.9
Редактум
Есть бесплатный тариф
4.8
ChadGPTChadgpt
По запросу
4.8
Cosmo ScribeCosmoscribe
Есть бесплатный тариф
4.8
Memo HelperCopilot33
По запросу
4.8
LibraChatLibrachat
Есть бесплатный тариф
4.8