zh.javascript.info README

The project's README from github.com/javascript-tutorial/zh.javascript.info. As one markdown file: README.md.

现代 JavaScript 教程中文版

本教程为 React 官方文档 与 MDN 共同推荐的前端教程,持续更新,永久免费,欢迎扫码关注微信公众号,加入读者群。

微信扫码关注公众号,加微信好友进群
加好友请备注 JS,不备注不通过

本项目托管了现代 JavaScript 教程中文版的内容,此内容发布在 https://zh.javascript.info

目录

翻译

我们希望本教程可以以更多语言呈现。如果你感兴趣,那就快来和我们一起翻译吧。

详见 翻译进度。

贡献指南

我们希望与更多人一起维护本教程。

发现有错误?发现有些主题教程中没有?那就赶快提交 Pull Request 来想大家分享你的知识吧 👏

你可以在任何编辑器中编辑本项目中的文件。本教程使用增强的 "MarkDown" 格式,易于掌握。而且,如果你想在本地预览效果,我们也提供了一个可以在本地运行本教程的服务端 https://github.com/javascript-tutorial/server。

详细贡献者列表请见 https://javascript.info/about#contributors。

翻译流程

请给维护者时间来审核和 merge 你的翻译,或者提出对应的修改意见。

如果你想成为一个维护者,请在 给我们提新 issue。

如果你愿意的话,请让其他人知道你在翻译这个教程,并尝试邀请他们参与翻译。你可以通过微博或群聊来号召。

🎉 非常感谢!

目前中文版已上线,我们会在“关于本项目”页面写上你的名字和贡献。

注:https://javascript.info/translate 列出了完整的语言列表。

文件结构

每一个章节或任务都有它自己的文件夹。

文件夹以 N-url 命名,N 为用于排序的数字,url 是该内容在网站上的链接中带有内容标题的部分。

文件的类型是依据文件夹中的文件定义的:

每一个文件都以 # 一级标题 开始。

添加新内容非常容易。

翻译提示

请不要添加换行,段落或移除已有的行和段落。这样可以减少 merge 英文版中的新变化时出现的问题。

如果你觉得英文版可以被改善 —— 欢迎,请给 英文版教程发 PR。

专有词条

补充:

词条含义

在英文中很多词条有明确的含义在內,但对于一个不了解英文的人来说,会忽略该含义。

请谨记有必要时可以多加解释或增加额外的翻译,例如:

`ReadableStream` objects allows to read data chunk-by-chunk.
`ReadableStream` objects 允许一个个资料块(chunk)地读取资料。

标点符号

代码块中的文本

例:

// Example
const text = "Hello, world";
document.querySelector('.hello').innerHTML = text;

✅ 请这样翻译(翻译注解):

// 范例
const text = 'Hello, world';
document.querySelector('.hello').innerHTML = text;

❌ 別翻译成(不要翻译类):

// 范例
const text = 'Hello, world';
// ".hello" 是一个类
// 不要翻译
document.querySelector('.你好').innerHTML = text;

外部链接

本翻译教程以维持原本外部链接为原则。

但如果这个外部链接是指向 Wikipedia 的,如 https://en.wikipedia.org/wiki/JavaScript,并且其有质量优良的目标语言的译文,请将链接指向该译文。

例如:

[JavaScript](https://en.wikipedia.org/wiki/JavaScript) is a programming language.

✅ OK (en -> zh):

[JavaScript](https://zh.wikipedia.org/wiki/JavaScript) 是一种编程语言。

对于指向 MDN 的外部链接,可以使用部分翻译的版本。

如果外部链接没有翻译的版本,请不要修改该链接。

诠释资料

一些文件,通常是练习题,顶部会有 YAML 的诠释资料(Metadata)并以 --- 分隔:

importance: 5

---
...

请不要翻译 “importance”(和其他放置在顶端的诠释资料)。

Anchors

某些标题以 [#anchor] 结尾,如:

## 扩散运算符 [#spread-operator]

请不要翻译或者去掉 [#...] 部分,它是 URL 锚点元素的依赖。

与英文版同步更新

详见 WIKI 中的「如何进行此教程的后续更新」。

管理员注意事项

详见 WIKI 中的「管理员注意事项」。

更多

更多说明请见 WIKI。

在本地运行

你可以在本地运行本教程的服务端来预览你的翻译。

运行服务端的教程请见 https://github.com/javascript-tutorial/server。


本中文版教程的核心维护者 🚀

Admin:

当前活跃维护者:

历史核心维护者:

我们希望与大家合作维护本教程。本教程的详细贡献者列表请见:https://zh.javascript.info/about。

zh.javascript.info (javascript-tutorial/zh.javascript.info)

Searching Database…

What is this?This is the Chinese translation of 'The Modern JavaScript Tutorial' (javascript.info), teaching JavaScript from basics to advanced topics based on the latest ECMAScript spec. It's recommended by both the official React docs and MDN.
Is this a code library or a learning resource?It's a learning resource — a collection of translated Markdown lesson and exercise files rendered as a tutorial website, not a code library or framework.
How do I read it or preview my translation changes?You can read the published tutorial on its hosted site, or clone the repo and run the local preview server to see how your edited pages render.
Do I need anything installed just to read the lessons?No — reading the tutorial online requires nothing extra; only running the local preview server to check translation edits needs a server setup, detailed in the project's Wiki.
Is the Chinese version always in sync with the original English tutorial?It's kept up to date through an ongoing sync process documented in the project's Wiki rather than being a one-time translation.
Are there special rules for translating exercise files?Exercise files often carry YAML metadata like 'importance' at the top, and translators are told not to translate this metadata or the [#anchor] URL fragments in headings.
Is there a community for readers of this translation?Yes, the README includes a WeChat QR code so readers can follow the official account and join a reader group (note required for friend requests).
Size
489.2 MB
Stars
10.8K
Updated
CommitMar 24
Age
8y
Commits · 90 Days