ES6 入门教程

《ECMAScript 6 入门教程》是一本开源的 JavaScript 语言教程,全面介绍 ECMAScript 6 新引入的语法特性。

cover

本书覆盖 ES6 与上一个版本 ES5 的所有不同之处,对涉及的语法知识给予详细介绍,并给出大量简洁易懂的示例代码。

本书为中级难度,适合已经掌握 ES5 的读者,用来了解这门语言的最新发展;也可当作参考手册,查寻新增的语法点。如果你是 JavaScript 语言的初学者,建议先学完《JavaScript 语言教程》,再来看本书。

全书已由电子工业出版社出版,2017年9月推出了第三版,书名为《ES6 标准入门》。纸版内容截止到出版时,网站内容一直在修订。

版权许可

本书采用“保持署名—非商用”创意共享4.0许可证。

只要保持原作者署名和非商用,您可以自由地阅读、分享、修改本书。

详细的法律条文请参见创意共享网站。

ruanyf/es6tutorial

{
"props": {
"initialPayload": {
"allShortcutsEnabled": false,
"path": "/",
"repo": {
"id": 18964487,
"defaultBranch": "gh-pages",
"name": "es6tutorial",
"ownerLogin": "ruanyf",
"currentUserCanPush": false,
"isFork": false,
"isEmpty": false,
"createdAt": "2014-04-20T13:06:28.000Z",
"ownerAvatar": "https://avatars.githubusercontent.com/u/905434?v=4",
"public": true,
"private": false,
"isOrgOwned": false
},
"currentUser": null,
"refInfo": {
"name": "gh-pages",
"listCacheKey": "v0:1397999370.0",
"canEdit": false,
"refType": "branch",
"currentOid": "43e44201a8688ab3c0c87f614e7d3c6b19f2d922"
},
"tree": {
"items": [
{
"name": "app/bower_components",
"path": "app/bower_components",
"contentType": "directory",
"hasSimplifiedPath": true
},
{
"name": "css",
"path": "css",
"contentType": "directory"
},
{
"name": "docs",
"path": "docs",
"contentType": "directory"
},
{
"name": "images",
"path": "images",
"contentType": "directory"
},
{
"name": "js",
"path": "js",
"contentType": "directory"
},
{
"name": ".DS_Store",
"path": ".DS_Store",
"contentType": "file"
},
{
"name": ".gitignore",
"path": ".gitignore",
"contentType": "file"
},
{
"name": ".nojekyll",
"path": ".nojekyll",
"contentType": "file"
},
{
"name": "404.html",
"path": "404.html",
"contentType": "file"
},
{
"name": "CNAME",
"path": "CNAME",
"contentType": "file"
},
{
"name": "LICENSE",
"path": "LICENSE",
"contentType": "file"
},
{
"name": "README.md",
"path": "README.md",
"contentType": "file"
},
{
"name": "SUMMARY.md",
"path": "SUMMARY.md",
"contentType": "file"
},
{
"name": "book.json",
"path": "book.json",
"contentType": "file"
},
{
"name": "config.js",
"path": "config.js",
"contentType": "file"
},
{
"name": "cover.jpg",
"path": "cover.jpg",
"contentType": "symlink_file"
},
{
"name": "cover_small.jpg",
"path": "cover_small.jpg",
"contentType": "symlink_file"
},
{
"name": "favicon.ico",
"path": "favicon.ico",
"contentType": "file"
},
{
"name": "index.html",
"path": "index.html",
"contentType": "file"
},
{
"name": "sidebar.md",
"path": "sidebar.md",
"contentType": "file"
}
],
"templateDirectorySuggestionUrl": null,
"readme": null,
"totalCount": 20,
"showBranchInfobar": false
},
"fileTree": null,
"fileTreeProcessingTime": null,
"foldersToFetch": [],
"treeExpanded": false,
"symbolsExpanded": false,
"isOverview": true,
"overview": {
"banners": {
"shouldRecommendReadme": false,
"isPersonalRepo": false,
"showUseActionBanner": false,
"actionSlug": null,
"actionId": null,
"showProtectBranchBanner": false,
"publishBannersInfo": {
"dismissActionNoticePath": "/settings/dismiss-notice/publish_action_from_repo",
"releasePath": "/ruanyf/es6tutorial/releases/new?marketplace=true",
"showPublishActionBanner": false
},
"interactionLimitBanner": null,
"showInvitationBanner": false,
"inviterName": null
},
"codeButton": {
"contactPath": "/contact",
"isEnterprise": false,
"local": {
"protocolInfo": {
"httpAvailable": true,
"sshAvailable": null,
"httpUrl": "https://github.com/ruanyf/es6tutorial.git",
"showCloneWarning": null,
"sshUrl": null,
"sshCertificatesRequired": null,
"sshCertificatesAvailable": null,
"ghCliUrl": "gh repo clone ruanyf/es6tutorial",
"defaultProtocol": "http",
"newSshKeyUrl": "/settings/ssh/new",
"setProtocolPath": "/users/set_protocol"
},
"platformInfo": {
"cloneUrl": "https://desktop.github.com",
"showVisualStudioCloneButton": false,
"visualStudioCloneUrl": "https://windows.github.com",
"showXcodeCloneButton": false,
"xcodeCloneUrl": "https://developer.apple.com",
"zipballUrl": "/ruanyf/es6tutorial/archive/refs/heads/gh-pages.zip"
}
},
"newCodespacePath": "/codespaces/new?hide_repo_select=true&repo=18964487"
},
"popovers": {
"rename": null,
"renamedParentRepo": null
},
"commitCount": "2,138",
"overviewFiles": [
{
"displayName": "README.md",
"repoName": "es6tutorial",
"refName": "gh-pages",
"path": "README.md",
"preferredFileType": "readme",
"tabName": "README",
"richText": "<article class=\"markdown-body entry-content container-lg\" itemprop=\"text\"><div class=\"markdown-heading\" dir=\"auto\"><h1 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\">ES6 入门教程</h1><a id=\"user-content-es6-入门教程\" class=\"anchor\" aria-label=\"Permalink: ES6 入门教程\" href=\"#es6-入门教程\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a></div>\n<ul dir=\"auto\">\n<li><a href=\"https://wangdoc.com/es6/\" rel=\"nofollow\">官方镜像</a></li>\n<li><a href=\"https://wangdoc.com/javascript\" rel=\"nofollow\">JavaScript 教程</a></li>\n<li><a href=\"https://wangdoc.com/typescript\" rel=\"nofollow\">TypeScript 教程</a></li>\n</ul>\n<p dir=\"auto\">《ECMAScript 6 入门教程》是一本开源的 JavaScript 语言教程,全面介绍 ECMAScript 6 新引入的语法特性。</p>\n<p dir=\"auto\"><a href=\"/ruanyf/es6tutorial/blob/gh-pages/images/cover-3rd.jpg\"><img src=\"/ruanyf/es6tutorial/raw/gh-pages/images/cover_thumbnail_3rd.jpg\" alt=\"cover\" style=\"max-width: 100%;\"></a></p>\n<p dir=\"auto\">本书覆盖 ES6 与上一个版本 ES5 的所有不同之处,对涉及的语法知识给予详细介绍,并给出大量简洁易懂的示例代码。</p>\n<p dir=\"auto\">本书为中级难度,适合已经掌握 ES5 的读者,用来了解这门语言的最新发展;也可当作参考手册,查寻新增的语法点。如果你是 JavaScript 语言的初学者,建议先学完<a href=\"https://wangdoc.com/javascript/\" rel=\"nofollow\">《JavaScript 语言教程》</a>,再来看本书。</p>\n<p dir=\"auto\">全书已由电子工业出版社出版,2017年9月推出了第三版,书名为《ES6 标准入门》。纸版内容截止到出版时,网站内容一直在修订。</p>\n<ul dir=\"auto\">\n<li><a href=\"https://s.taobao.com/search?q=ES6%E6%A0%87%E5%87%86%E5%85%A5%E9%97%A8+%E7%AC%AC3%E7%89%88\" rel=\"nofollow\">淘宝</a></li>\n<li><a href=\"https://search.jd.com/Search?keyword=ES6%E6%A0%87%E5%87%86%E5%85%A5%E9%97%A8%20%E7%AC%AC3%E7%89%88&amp;enc=utf-8&amp;wq=ES6%E6%A0%87%E5%87%86%E5%85%A5%E9%97%A8%20%E7%AC%AC3%E7%89%88\" rel=\"nofollow\">京东</a></li>\n<li><a href=\"https://product.dangdang.com/25156888.html\" rel=\"nofollow\">当当</a></li>\n</ul>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\">版权许可</h3><a id=\"user-content-版权许可\" class=\"anchor\" aria-label=\"Permalink: 版权许可\" href=\"#版权许可\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a></div>\n<p dir=\"auto\">本书采用“保持署名—非商用”创意共享4.0许可证。</p>\n<p dir=\"auto\">只要保持原作者署名和非商用,您可以自由地阅读、分享、修改本书。</p>\n<p dir=\"auto\">详细的法律条文请参见<a href=\"http://creativecommons.org/licenses/by-nc/4.0/\" rel=\"nofollow\">创意共享</a>网站。</p>\n</article>",
"loaded": true,
"timedOut": false,
"errorMessage": null,
"headerInfo": {
"toc": [
{
"level": 1,
"text": "ES6 入门教程",
"anchor": "es6-入门教程",
"htmlText": "ES6 入门教程"
},
{
"level": 3,
"text": "版权许可",
"anchor": "版权许可",
"htmlText": "版权许可"
}
],
"siteNavLoginPath": "/login?return_to=https%3A%2F%2Fgithub.com%2Fruanyf%2Fes6tutorial"
}
},
{
"displayName": "LICENSE",
"repoName": "es6tutorial",
"refName": "gh-pages",
"path": "LICENSE",
"preferredFileType": "license",
"tabName": "License",
"richText": null,
"loaded": false,
"timedOut": false,
"errorMessage": null,
"headerInfo": {
"toc": null,
"siteNavLoginPath": "/login?return_to=https%3A%2F%2Fgithub.com%2Fruanyf%2Fes6tutorial"
}
}
],
"overviewFilesProcessingTime": 0
}
},
"appPayload": {
"helpUrl": "https://docs.github.com",
"findFileWorkerPath": "/assets-cdn/worker/find-file-worker-1583894afd38.js",
"findInFileWorkerPath": "/assets-cdn/worker/find-in-file-worker-3a63a487027b.js",
"githubDevUrl": null,
"enabled_features": {
"code_nav_ui_events": false,
"overview_shared_code_dropdown_button": false,
"react_blob_overlay": false,
"copilot_conversational_ux_embedding_update": false,
"copilot_smell_icebreaker_ux": true,
"copilot_workspace": false
}
}
}
}
{
"accept-ranges": "bytes",
"cache-control": "max-age=0, private, must-revalidate",
"content-encoding": "gzip",
"content-security-policy": "default-src 'none'; base-uri 'self'; child-src github.com/assets-cdn/worker/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com api.githubcopilot.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com/v1/engines/github-completion/completions proxy.enterprise.githubcopilot.com/v1/engines/github-completion/completions *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.com/assets-cdn/worker/ gist.github.com/assets-cdn/worker/",
"content-type": "text/html; charset=utf-8",
"date": "Sat, 27 Jul 2024 07:03:34 GMT",
"etag": "6be157bedf136596fba41a02618a8814",
"referrer-policy": "no-referrer-when-downgrade",
"server": "GitHub.com",
"set-cookie": "logged_in=no; Path=/; Domain=github.com; Expires=Sun, 27 Jul 2025 07:03:34 GMT; HttpOnly; Secure; SameSite=Lax",
"strict-transport-security": "max-age=31536000; includeSubdomains; preload",
"transfer-encoding": "chunked",
"vary": "X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, Accept-Encoding, Accept, X-Requested-With",
"x-content-type-options": "nosniff",
"x-frame-options": "deny",
"x-github-request-id": "E088:1F6FBB:CCF2A8:10622A0:66A49BBE",
"x-xss-protection": "0"
}