← 返回 Skills 市场
ivangdavila

JavaScript

作者 Iván · GitHub ↗ · v1.0.3
cross-platform ✓ 安全检测通过
2626
总下载
5
收藏
20
当前安装
4
版本数
在 OpenClaw 中安装
/install javascript
功能描述
Write robust JavaScript with async patterns, type coercion handling, and modern ES2023+ features.
使用说明 (SKILL.md)

When to Use

User needs JavaScript expertise — from core language features to modern patterns. Agent handles async/await, closures, module systems, and ES2023+ features.

Quick Reference

Topic File
Async patterns async.md
Type coercion rules coercion.md
Array and object methods collections.md
Modern ES features modern.md

Equality Traps

  • == coerces: "0" == false is true — use === always
  • NaN !== NaN — use Number.isNaN(), not === NaN
  • typeof null === "object" — check === null explicitly
  • Objects compare by reference — {} === {} is false

this Binding

  • Regular functions: this depends on call site — lost in callbacks
  • Arrow functions: this from lexical scope — use for callbacks
  • setTimeout(obj.method) loses this — use arrow or .bind()
  • Event handlers: this is element in regular function, undefined in arrow (if no outer this)

Closure Traps

  • Loop variable captured by reference — let in loop or IIFE to capture value
  • var hoisted to function scope — creates single binding shared across iterations
  • Returning function from loop: all share same variable — use let per iteration

Array Mutation

  • sort(), reverse(), splice() mutate original — use toSorted(), toReversed(), toSpliced() (ES2023)
  • push(), pop(), shift(), unshift() mutate — spread [...arr, item] for immutable
  • delete arr[i] leaves hole — use splice(i, 1) to remove and reindex
  • Spread and Object.assign are shallow — nested objects still reference original

Async Pitfalls

  • Forgetting await returns Promise, not value — easy to miss without TypeScript
  • forEach doesn't await — use for...of for sequential async
  • Promise.all fails fast — one rejection rejects all, use Promise.allSettled if need all results
  • Unhandled rejection crashes in Node — always .catch() or try/catch with await

Numbers

  • 0.1 + 0.2 !== 0.3 — floating point, use integer cents or toFixed() for display
  • parseInt("08") works now — but parseInt("0x10") is 16, watch prefixes
  • Number("") is 0, Number(null) is 0 — but Number(undefined) is NaN
  • Large integers lose precision over 2^53 — use BigInt for big numbers

Iteration

  • for...in iterates keys (including inherited) — use for...of for values
  • for...of on objects fails — objects aren't iterable, use Object.entries()
  • Object.keys() skips non-enumerable — Reflect.ownKeys() gets all including symbols

Implicit Coercion

  • [] + [] is "" — arrays coerce to strings
  • [] + {} is "[object Object]" — object toString
  • {} + [] is 0 in console — {} parsed as block, not object
  • "5" - 1 is 4, "5" + 1 is "51" — minus coerces, plus concatenates

Strict Mode

  • "use strict" at top of file or function — catches silent errors
  • Implicit globals throw in strict — x = 5 without declaration fails
  • this is undefined in strict functions — not global object
  • Duplicate parameters and with forbidden
安全使用建议
This skill is a documentation-only helper for JavaScript: it doesn't install software or ask for credentials, and its content matches its description. You can install it without exposing secrets or adding software. As with any coding advice, review generated code and test it in your environment — the docs may contain minor language mixing (some Spanish fragments) and the guidance can suggest patterns that still need adaptation to your project (e.g., error handling, performance). If you need the agent to execute code or access your repo, only grant those capabilities intentionally and separately.
功能分析
Type: OpenClaw Skill Name: javascript Version: 1.0.3 The skill bundle consists entirely of markdown files providing educational content about JavaScript pitfalls and best practices. There is no executable code, and the markdown instructions do not contain any prompt injection attempts or directives that would lead an AI agent to perform malicious actions such as data exfiltration, unauthorized execution, or persistence. All content aligns with the stated purpose of offering JavaScript expertise.
能力评估
Purpose & Capability
The name/description promise JavaScript guidance; the SKILL.md and the four topic files provide exactly that (async patterns, coercion, collection methods, modern ES features). There are no unrelated requirements (no env vars, no binaries, no install).
Instruction Scope
SKILL.md and the included docs are purely advisory reference material for writing JS. They do not instruct the agent to read system files, call external endpoints, access credentials, or perform actions outside of producing guidance or code examples.
Install Mechanism
No install spec and no code files — nothing is written to disk or downloaded. This is the lowest-risk form (instruction-only).
Credentials
The skill declares no environment variables, credentials, or config paths. Nothing requested is disproportionate to providing language guidance.
Persistence & Privilege
always:false and default autonomous invocation are appropriate for a user-invocable knowledge skill. The skill does not request persistent system privileges or modify other skills' configs.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install javascript
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /javascript 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.3
Initial release
v1.0.2
Auxiliares rehecho con 100% trampas
v1.0.1
Upgrade: nueva estructura con archivos auxiliares, manteniendo todas las trampas originales
v1.0.0
Initial release
元数据
Slug javascript
版本 1.0.3
许可证
累计安装 20
当前安装数 20
历史版本数 4
常见问题

JavaScript 是什么?

Write robust JavaScript with async patterns, type coercion handling, and modern ES2023+ features. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 2626 次。

如何安装 JavaScript?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install javascript」即可一键安装,无需额外配置。

JavaScript 是免费的吗?

是的,JavaScript 完全免费(开源免费),可自由下载、安装和使用。

JavaScript 支持哪些平台?

JavaScript 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 JavaScript?

由 Iván(@ivangdavila)开发并维护,当前版本 v1.0.3。

💬 留言讨论