Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
219 commits
Select commit Hold shift + click to select a range
c5cf744
MetaKey is repeated.
Michael18811380328 Jul 27, 2019
e5b8e8c
Merge pull request #139 from Michael18811380328/patch-1
ruanyf Jul 27, 2019
9d0d7a5
docs(dom): edit document/document.queryCommandSupported
ruanyf Jul 29, 2019
33d53dc
docs(dom): edit document/document.queryCommandSupported
ruanyf Jul 29, 2019
33d67a3
change words
Michael18811380328 Jul 30, 2019
d7ec7c7
Merge pull request #140 from Michael18811380328/patch-2
ruanyf Jul 30, 2019
391c543
docs(bom): fix xmlhttprequest
ruanyf Jul 30, 2019
f32118c
Update xmlhttprequest.md
Michael18811380328 Aug 7, 2019
17af7cb
Merge pull request #141 from Michael18811380328/patch-3
ruanyf Aug 7, 2019
e8997b2
fix CORS
Michael18811380328 Aug 8, 2019
0456738
Merge pull request #142 from Michael18811380328/patch-4
ruanyf Aug 8, 2019
b4e7f36
docs(bom): edit location.host
ruanyf Aug 8, 2019
cb92103
change words
Michael18811380328 Aug 8, 2019
339d5fd
Merge pull request #144 from Michael18811380328/patch-6
ruanyf Aug 9, 2019
68e25ae
docs(dom): edit document
ruanyf Aug 27, 2019
c4c14a8
refact: update dependencies
ruanyf Aug 27, 2019
304fd07
refact: update dependencies
ruanyf Aug 27, 2019
4f78aa4
docs(bom): edit Cookie
ruanyf Sep 9, 2019
ecef955
docs(dom): edit CSS
ruanyf Sep 10, 2019
ad6049a
docs(dom): edit mutationobserver
ruanyf Sep 12, 2019
11d71b0
docs(bom): edit form
ruanyf Sep 12, 2019
dcd00fe
更正 'instanceOf' 拼写
Sep 17, 2019
10a2e3a
Merge pull request #148 from Veminem/master
ruanyf Sep 18, 2019
727c26c
docs(bom): edit form
ruanyf Sep 30, 2019
486addf
Update arraybuffer.md
harriet247 Oct 3, 2019
cbf8fcf
docs(stdlib): edit array/sort
ruanyf Oct 6, 2019
ae4e9cf
docs(stdlib): edit array/sort
ruanyf Oct 6, 2019
b8523bc
docs(stdlib): edit Number/toLocalString()
ruanyf Oct 6, 2019
c634d26
Merge pull request #152 from harriet247/patch-1
ruanyf Oct 10, 2019
23e3bcb
docs(bom): fix #154
ruanyf Oct 30, 2019
ff74e42
refactor: upgrade node.js
ruanyf Oct 30, 2019
786148c
docs: fix #155
ruanyf Nov 4, 2019
19d0628
docs(stdlib): fix Date.setDate
ruanyf Nov 11, 2019
d3e17b1
docs(bom): edit window
ruanyf Nov 14, 2019
4e1e7dd
docs: fix #157
ruanyf Nov 22, 2019
7f65d8b
docs: fix #158
ruanyf Nov 28, 2019
173611c
fixed typo
atimidguy Dec 24, 2019
c26890b
Merge pull request #159 from atimidguy/patch-1
ruanyf Dec 24, 2019
5312a09
typo
jacty Jan 6, 2020
4aad260
Merge pull request #160 from jacty/patch-1
ruanyf Jan 9, 2020
f71489d
docs(stdlib): edit regexp/exec()
ruanyf Feb 13, 2020
23b342a
docs(dom): add document.currentScript
ruanyf Feb 21, 2020
b710608
docs(error): fix #161
ruanyf Feb 27, 2020
20423b9
docs(stdlib/number): fix #162
ruanyf Mar 4, 2020
136026a
docs(dom/css): fix typo
ruanyf Mar 16, 2020
a975c0c
docs(oop/this): fix #165
ruanyf Mar 17, 2020
2f728aa
docs(DOM): fix #167
ruanyf Mar 17, 2020
0f286ea
修改函数提升表述问题。
xiaobeiqiaodaima Mar 17, 2020
5b3c5da
Merge pull request #168 from xiaobeiqiaodaima/patch-1
ruanyf Mar 18, 2020
aa26f6d
docs(types/function): edit 函数提升
ruanyf Mar 18, 2020
a4bd6ee
docs(stdlib): edit math/Math.pow()
ruanyf Apr 6, 2020
65d72c0
docs(stdlib/string): fix typo
ruanyf Apr 6, 2020
5075536
docs(stdlib): edit array
ruanyf Apr 13, 2020
24db3a8
refactor: update dependencies
ruanyf Apr 13, 2020
7d37676
refactor: update travis-ci node.js version
ruanyf Apr 13, 2020
2baaafd
refactor: add lopp server command
ruanyf Apr 13, 2020
1dad034
docs(types): edit function
ruanyf Apr 14, 2020
0ea89ff
docs(dom): edit mutation observer
ruanyf Apr 14, 2020
d684762
docs(dom): edit element
ruanyf Apr 14, 2020
17c27fd
refactor: edit travis.yml
ruanyf Apr 15, 2020
97a398b
fix: 反单引号补全
byog Apr 22, 2020
287467c
Merge pull request #170 from byog/patch-1
ruanyf Apr 22, 2020
58ee1ec
docs(operator): edit boolean operator, fix #173
ruanyf May 14, 2020
3adc5a4
Merge branch 'master' of github.com:wangdoc/javascript-tutorial
ruanyf May 14, 2020
4e7aacb
docs(event): edit model, fix #174
ruanyf May 14, 2020
91161ff
docs(operator): edit bit operator
ruanyf May 14, 2020
1b0b7b8
docs(event): edit load / unload event
ruanyf May 22, 2020
9eb914d
docs(types): edit array
ruanyf May 25, 2020
48619c0
docs(operator): edit 结合性
ruanyf May 25, 2020
0d10e3b
docs(bom): edit 同源政策
ruanyf May 31, 2020
7afc477
refactor: update dependencies
ruanyf May 31, 2020
3f8e88a
docs(stdlib/attribute): fix #175
ruanyf Jun 11, 2020
4b98a2c
docs(stdlib/regex): edit 贪婪模式
ruanyf Jun 12, 2020
7b4c045
docs(string): fixed slice() #176
ruanyf Jun 12, 2020
2d95d1e
docs(dom): edit document.getElementsByTagName
ruanyf Jun 21, 2020
3d936cd
docs: edit README
ruanyf Jun 24, 2020
16df62c
docs: edit README
ruanyf Jun 24, 2020
db23e4c
build(deps): bump lodash from 4.17.15 to 4.17.19
dependabot[bot] Jul 15, 2020
5efef16
Merge pull request #179 from wangdoc/dependabot/npm_and_yarn/lodash-4…
ruanyf Jul 16, 2020
e793217
docs(types/function): edit 函数定义后面的圆括号
ruanyf Aug 2, 2020
7cb09b2
Update math.md
byog Aug 4, 2020
a77ba27
Merge pull request #182 from byog/patch-1
ruanyf Aug 6, 2020
d0ae41c
docs(stdlib/regex): fix typo
ruanyf Aug 24, 2020
a2aed61
fix: typo
byog Aug 26, 2020
9ab17c0
Update engine.md
byog Aug 27, 2020
ab48299
Merge pull request #184 from byog/patch-2
ruanyf Aug 29, 2020
b2be754
Merge pull request #183 from byog/patch-1
ruanyf Aug 29, 2020
913da4b
docs: edit bom/engine & event/drag
ruanyf Aug 29, 2020
be0c31d
docs(operators): fix #185
ruanyf Sep 10, 2020
e121042
docs(operator/comparison): fix #186
ruanyf Sep 15, 2020
1fb851b
refactor: update dependencies
ruanyf Sep 15, 2020
3336dab
docs(events): fix typo
ruanyf Sep 23, 2020
26a4628
docs(stdlib): edit JSON
ruanyf Sep 26, 2020
f86175c
Typo
jacty Sep 27, 2020
5b34e4f
Merge pull request #187 from jacty/patch-2
ruanyf Sep 27, 2020
8259709
docs(types/function): fix typo
ruanyf Sep 27, 2020
aa04c24
docs(types/function): fix #188
ruanyf Sep 27, 2020
f53a87a
Update event.md
lutherlau Oct 1, 2020
f0cdffa
Update drag.md
lutherlau Oct 2, 2020
e0e597f
Merge pull request #190 from lutherlau/patch-1
ruanyf Oct 3, 2020
b98d845
Merge pull request #192 from lutherlau/patch-2
ruanyf Oct 3, 2020
df48e91
docs(event/common): edit throttle() #193
ruanyf Oct 3, 2020
ad50de3
Merge branch 'master' of github.com:wangdoc/javascript-tutorial
ruanyf Oct 3, 2020
2e50838
docs(events/common): edit throttle()
ruanyf Oct 3, 2020
74a452b
Update window.md
lutherlau Oct 8, 2020
c36af18
Merge pull request #194 from lutherlau/patch-4
ruanyf Oct 8, 2020
a4c7ad9
Update window.md
lutherlau Oct 8, 2020
c6b4ccc
Update navigator.md
lutherlau Oct 9, 2020
4e4a5a6
Update webworker.md
lutherlau Oct 11, 2020
09f0758
Update input.md
lutherlau Oct 11, 2020
aa4e381
docs(oop/new): fix #200
ruanyf Oct 15, 2020
73384a2
docs(oop/new): edit text
ruanyf Oct 16, 2020
a113717
Merge pull request #195 from lutherlau/patch-5
ruanyf Oct 16, 2020
2527ece
Merge pull request #196 from lutherlau/patch-6
ruanyf Oct 16, 2020
c4b4d1f
Merge pull request #197 from lutherlau/patch-7
ruanyf Oct 17, 2020
3bcd410
Merge pull request #198 from lutherlau/patch-8
ruanyf Oct 17, 2020
9fe39f1
docs(elements): edit input/setRangeText
ruanyf Oct 17, 2020
96fc3fe
docs(feature/conversion): fix typo #199
ruanyf Oct 17, 2020
95e0e1a
docs(events): edit paste event
ruanyf Oct 23, 2020
025dd71
docs(events): edit paste event
ruanyf Oct 24, 2020
aaa117a
docs(elements/video): fix #201
ruanyf Oct 27, 2020
cce2da1
docs(oop/object): edit Object.create()
ruanyf Oct 27, 2020
78e09da
docs(oop/prototype/instanceof): fix #203
ruanyf Nov 5, 2020
3898d66
docs(oop/prototype): fix typo
ruanyf Nov 6, 2020
ce1ed09
docs(dom): edit parentNode
ruanyf Dec 1, 2020
2403863
docs(dom): edit parentNode
ruanyf Dec 1, 2020
75a986b
docs(types/function): edit closure #204
ruanyf Dec 2, 2020
d1a2ff0
refactor: update dependencies
ruanyf Dec 9, 2020
7094b33
docs(bom/arraybuffer): fix #206
ruanyf Dec 9, 2020
d904070
docs(bom/webworker): fix #207
ruanyf Dec 16, 2020
5817935
refactor: update dependencies
ruanyf Dec 16, 2020
534b913
feat: switch CI from Travis-CI to GitHub Actions
ruanyf Dec 18, 2020
6f22958
refactor: update dependencies
ruanyf Dec 18, 2020
0d4bbdc
docs(bom): edit URL
ruanyf Dec 20, 2020
881f0b2
refactor: update dependencies
ruanyf Dec 24, 2020
51a586c
docs(XMLHttpRequest: fix #211
ruanyf Jan 14, 2021
a9c543b
docs(bom): fix location
ruanyf Jan 22, 2021
692eb71
#212 FIX 9.3 Object.defineProperty,对象名o应该是obj
LiangWanQiang Feb 4, 2021
a655e45
Merge pull request #213 from LiangWanQiang/master
ruanyf Feb 11, 2021
df064ca
docs(stdlib/array): fix typo
ruanyf Feb 11, 2021
d848f18
refactor: update dependencies
ruanyf Feb 12, 2021
5002077
refactor: update dependencies
ruanyf Feb 12, 2021
962851d
docs(event/drag): fix typo
ruanyf Feb 12, 2021
173079e
docs(basic/history): fixed #214
ruanyf Feb 14, 2021
d492be0
docs(types/general): fixed #215
ruanyf Feb 14, 2021
39c49f3
docs(bom/storage): fixed #216
ruanyf Feb 24, 2021
6ff80f2
docs(bom/storage): fixed #216
ruanyf Feb 24, 2021
ac09300
docs(feat/error): edit text
ruanyf Mar 7, 2021
78db150
build(deps): bump lodash from 4.17.20 to 4.17.21
dependabot[bot] May 6, 2021
6ad40b3
Merge pull request #217 from wangdoc/dependabot/npm_and_yarn/lodash-4…
ruanyf May 7, 2021
3e1522e
refactor: update theme
ruanyf May 11, 2021
9cc8c56
Merge branch 'master' of github.com:wangdoc/javascript-tutorial
ruanyf May 11, 2021
db30f68
docs(feature/error): fixed text
ruanyf May 11, 2021
4164309
Update grammar.md
mikusaa May 15, 2021
e1791a0
Merge pull request #1 from mikusaa/patch-1
mikusaa May 15, 2021
2945da6
Update function.md
mikusaa May 15, 2021
fe154d4
语病修正
mikusaa May 15, 2021
550481f
Merge pull request #223 from mikusaa/master
ruanyf May 18, 2021
68c0503
docs(basic/grammar): fix typo
ruanyf May 18, 2021
9ca16cd
docs(stdlib/array): edit text
ruanyf May 25, 2021
bae4e98
docs(stdlib/attribute): fixed #226 edit configurable
ruanyf Jul 14, 2021
e90b8a1
docs(stdlib/array): fixed #228 reduce()
ruanyf Jul 21, 2021
95e72ae
docs(dom/document): edit document.stylesheets
ruanyf Aug 5, 2021
3d8337c
docs(dom/mutationobserver): fix typo
ruanyf Aug 9, 2021
5d7484c
docs(event/eventTarget): fixed #231
ruanyf Aug 9, 2021
3e1a5b6
docs(event/eventtarget): edit text
ruanyf Aug 10, 2021
c506408
docs(event/mouse): edit text
ruanyf Aug 17, 2021
e0f60d4
docs(event/mouse): edit text
ruanyf Aug 17, 2021
24b5353
docs: fix typo
ruanyf Aug 24, 2021
76f4676
docs(bom/indexedDB): edit IDBCursor
ruanyf Sep 1, 2021
9d3c01a
docs(elements/video): edit HTMLMediaElement.src
ruanyf Sep 1, 2021
4ba7e40
refactor: edit theme
ruanyf Sep 5, 2021
53ae0a3
docs(types/array): edit array hole
ruanyf Sep 11, 2021
b924c7d
docs(bom/cookie): edit cookie
ruanyf Sep 19, 2021
cca8027
docs(bom/navigator): edit text
ruanyf Sep 27, 2021
5fd3d34
docs(bom/cookie): edit domain property
ruanyf Oct 4, 2021
8ea8724
docs(dom/element): fixed #234
ruanyf Oct 28, 2021
c426ae2
docs(dom/nodelist): edit HTMLCollection.prototype.namedItem()
ruanyf Oct 29, 2021
074e7f5
docs(stdlib/date): fix #237
ruanyf Feb 5, 2022
f901426
docs: fix url (#239)
Mar 1, 2022
bf18144
docs(types/function): fix #239 broken reference link
ruanyf Mar 1, 2022
b5ccb91
跟 160 行的 Content-Type 重复了 (#241)
hehe1111 Apr 5, 2022
c073782
docs(elements/input): edit valueAsNumber
ruanyf Apr 7, 2022
ff16631
docs(bom/xmlhttprequest): edit Navigator.sendBeacon()
ruanyf Apr 10, 2022
37de2eb
docs(types/function): fix #245
ruanyf May 18, 2022
ad7cd2b
Update number.md (#247)
yuu2lee4 Jun 7, 2022
87ce3dc
Update regexp.md (#249)
IKKI2000 Jun 30, 2022
91b5581
Update date.md (#250)
IKKI2000 Jun 30, 2022
6eeecbf
docs(basic/grammar): fix typo #253
ruanyf Nov 16, 2022
eeb6d15
fix: 运算符/比较运算符 文案错误 (#254)
Hencky Dec 28, 2022
2e3f11b
docs(operator/comparison): fix text
ruanyf Feb 2, 2023
6dc6fb5
Update cookie.md (#255)
lio-mengxiang Feb 4, 2023
133c2d4
docs(bom/cookie): edit set-cookie's domain property
ruanyf Feb 4, 2023
482a517
fix translation about cross-origin (#256)
fwqaaq Feb 12, 2023
0887afc
docs(stdlib/JSON): add JSON.parse(JSON.stringify(obj))
ruanyf Jul 23, 2023
9f7eb46
docs(types/general): add ES6 BigInt type (#260)
sdshaoda Aug 10, 2023
f05cc4a
docs(general): use '===' replace '==' (#261)
thinkasany Aug 17, 2023
4f58c96
docs(stdlib/regex): fixed #263
ruanyf Dec 30, 2023
35bbedb
docs(oop/strict): fixed #265
ruanyf Jan 3, 2024
1868d0a
fix: 修复scrollHeight注释错误 (#266)
EnochGao Jan 5, 2024
d9420c3
fix: 对齐3.1observe()案例代码 (#267)
EnochGao Jan 9, 2024
d77ebe8
docs(bom/same-origin): fix error
ruanyf Feb 3, 2024
a132886
fix: 修复文档字符串错误 (#268)
EnochGao Feb 4, 2024
3a7a19a
docs(stdlib/date): fixed #269
ruanyf Feb 24, 2024
7070f24
docs(types/number): fixed #270
ruanyf Apr 19, 2024
83aea13
docs(dom): fix text (#271)
cogic Apr 22, 2024
2092d3b
docs(dom/css): fixed #272
ruanyf Apr 24, 2024
eefffcf
docs(dom/css): fix text (#273)
cogic Apr 25, 2024
2f55be8
docs(dom/document): fixed #274
ruanyf May 4, 2024
370bb5f
refactor: update dependencies
ruanyf Jun 9, 2024
56a5093
refactor: update github action script
ruanyf Jun 9, 2024
5aa689b
docs(bom/window): fixed #277
ruanyf Jun 24, 2024
200b44e
docs(oop/this): fixed #279
ruanyf Jul 4, 2024
1df4272
统一引号 (#282)
Linho1219 Sep 24, 2024
5f4a988
补充 NaN 运算规则 (#283)
Linho1219 Sep 24, 2024
79dcc9b
style: force update theme
ruanyf Sep 25, 2024
2500a08
fix(docs): 6.2注释错误 (#287)
EnochGao Dec 9, 2024
e4622c2
docs(oop/strict): fixed typo
ruanyf Dec 25, 2024
a428ce9
fix(docs): 修复引用章节名称错误,避免阅读模糊不清 (#291)
EnochGao Sep 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/wangdoc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: JavaScript tutorial CI
on:
push:
branches:
- master

jobs:
page-generator:
name: Generating pages
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'latest'
- name: Install dependencies
run: npm install
- name: Build pages
run: npm run build
- name: Deploy to website
uses: JamesIves/github-pages-deploy-action@v4
with:
git-config-name: wangdoc-bot
git-config-email: [email protected]
repository-name: wangdoc/website
token: ${{ secrets.WANGDOC_BOT_TOKEN }}
branch: master # The branch the action should deploy to.
folder: dist # The folder the action should deploy.
target-folder: dist/javascript
clean: true # Automatically remove deleted files from the deploy branch
commit-message: update from JavaScript tutorial

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
node_modules/
dist/
package-lock.json
npm-debug.log
package-lock.json
9 changes: 8 additions & 1 deletion .travis.yml → .travis.yml.bak
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
language: node_js
node_js:
- '8'
- 'node'

branches:
only:
- master

install:
- npm ci
# keep the npm cache around to speed up installs
cache:
directories:
- "$HOME/.npm"

script: bash ./deploy.sh
env:
global:
Expand Down
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
本教程全面介绍 JavaScript 核心语法,从最简单的讲起,循序渐进、由浅入深,力求清晰易懂。所有章节都带有大量的代码实例,便于理解和模仿,可以用到实际项目中,即学即用。
本教程全面介绍 JavaScript 核心语法,覆盖了 ES5 和 DOM 规范的所有内容。

内容上从最简单的讲起,循序渐进、由浅入深,力求清晰易懂。所有章节都带有大量的代码实例,便于理解和模仿,可以用到实际项目中,即学即用。

本教程适合初学者当作 JavaScript 语言入门教程,学完后就可以承担实际的网页开发工作,也适合当作日常使用的参考手册。

JavaScript 后续新增的 ES6 语法,请看[《ES6 标准入门教程》](https://wangdoc.com/es6/)。

本教程适合初学者当作 JavaScript 语言入门教程,也适合当作日常使用的参考手册。
4 changes: 2 additions & 2 deletions docs/async/general.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ JavaScript 之所以采用单线程,而不是多线程,跟历史有关系。

如果排队是因为计算量大,CPU 忙不过来,倒也算了,但是很多时候 CPU 是闲着的,因为 IO 操作(输入输出)很慢(比如 Ajax 操作从网络读取数据),不得不等着结果出来,再往下执行。JavaScript 语言的设计者意识到,这时 CPU 完全可以不管 IO 操作,挂起处于等待中的任务,先运行排在后面的任务。等到 IO 操作返回了结果,再回过头,把挂起的任务继续执行下去。这种机制就是 JavaScript 内部采用的“事件循环”机制(Event Loop)。

单线程模型虽然对 JavaScript 构成了很大的限制,但也因此使它具备了其他语言不具备的优势。如果用得好,JavaScript 程序是不会出现堵塞的,这就是为什么 Node 可以用很少的资源,应付大流量访问的原因。
单线程模型虽然对 JavaScript 构成了很大的限制,但也因此使它具备了其他语言不具备的优势。如果用得好,JavaScript 程序是不会出现堵塞的,这就是 Node.js 可以用很少的资源,应付大流量访问的原因。

为了利用多核 CPU 的计算能力,HTML5 提出 Web Worker 标准,允许 JavaScript 脚本创建多个线程,但是子线程完全受主线程控制,且不得操作 DOM。所以,这个新标准并没有改变 JavaScript 单线程的本质。

Expand Down Expand Up @@ -271,7 +271,7 @@ function launcher() {
running--;
if(items.length > 0) {
launcher();
} else if(running == 0) {
} else if(running === 0) {
final(results);
}
});
Expand Down
2 changes: 1 addition & 1 deletion docs/async/promise.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ console.log(3);

## 参考链接

- Sebastian Porto, [Asynchronous JS: Callbacks, Listeners, Control Flow Libs and Promises](http://sporto.github.com/blog/2012/12/09/callbacks-listeners-promises/)
- Sebastian Porto, [Asynchronous JS: Callbacks, Listeners, Control Flow Libs and Promises](https://sporto.github.io/blog/2012/12/09/callbacks-listeners-promises/)
- Rhys Brett-Bowen, [Promises/A+ - understanding the spec through implementation](http://modernjavascript.blogspot.com/2013/08/promisesa-understanding-by-doing.html)
- Matt Podwysocki, Amanda Silver, [Asynchronous Programming in JavaScript with “Promises”](http://blogs.msdn.com/b/ie/archive/2011/09/11/asynchronous-programming-in-javascript-with-promises.aspx)
- Marc Harter, [Promise A+ Implementation](https://gist.github.com//wavded/5692344)
Expand Down
6 changes: 3 additions & 3 deletions docs/basic/grammar.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ JavaScript 提供`if`结构和`switch`结构,完成条件判断,即只有满

### if 结构

`if`结构先判断一个表达式的布尔值,然后根据布尔值的真伪,执行不同的语句。所谓布尔值,指的是 JavaScript 的两个特殊值,`true`表示真,`false`表示`伪`
`if`结构先判断一个表达式的布尔值,然后根据布尔值的真伪,执行不同的语句。所谓布尔值,指的是 JavaScript 的两个特殊值,`true`表示“真”,`false`表示“伪”

```javascript
if (布尔值)
Expand Down Expand Up @@ -485,7 +485,7 @@ var msg = '数字' + n + '是' + (n % 2 === 0 ? '偶数' : '奇数');

### while 循环

`While`语句包括一个循环条件和一段代码块,只要条件为真,就不断循环执行代码块。
`while`语句包括一个循环条件和一段代码块,只要条件为真,就不断循环执行代码块。

```javascript
while (条件)
Expand Down Expand Up @@ -727,4 +727,4 @@ top:

## 参考链接

- Axel Rauschmayer, [A quick overview of JavaScript](http://www.2ality.com/2011/10/javascript-overview.html)
- Axel Rauschmayer, [Basic JavaScript for the impatient programmer](https://2ality.com/2013/06/basic-javascript.html)
8 changes: 4 additions & 4 deletions docs/basic/history.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ JavaScript 伴随着互联网的发展一起发展。互联网周边技术的快

2007年,Webkit 引擎在 iPhone 手机中得到部署。它最初基于 KDE 项目,2003年苹果公司首先采用,2005年开源。这标志着 JavaScript 语言开始能在手机中使用了,意味着有可能写出在桌面电脑和手机中都能使用的程序。

2007年,Douglas Crockford 发表了名为《JavaScript: The good parts》的演讲,次年由 O'Reilly 出版社出版。这标志着软件行业开始严肃对待 JavaScript 语言,对它的语法开始重新认识
2007年,Douglas Crockford 发表了名为《JavaScript: The good parts》的演讲,次年由 O'Reilly 出版社出版。这标志着软件行业开始严肃对待 JavaScript 语言,对它的语法开始重新认识

2008年,V8 编译器诞生。这是 Google 公司为 Chrome 浏览器而开发的,它的特点是让 JavaScript 的运行变得非常快。它提高了 JavaScript 的性能,推动了语法的改进和标准化,改变外界对 JavaScript 的不佳印象。同时,V8 是开源的,任何人想要一种快速的嵌入式脚本语言,都可以采用 V8,这拓展了 JavaScript 的应用领域。

Expand Down Expand Up @@ -181,7 +181,7 @@ JavaScript 伴随着互联网的发展一起发展。互联网周边技术的快

## 参考链接

- Axel Rauschmayer, [The Past, Present, and Future of JavaScript](http://oreilly.com/javascript/radarreports/past-present-future-javascript.csp)
- Axel Rauschmayer, [The Past, Present, and Future of JavaScript](https://www.oreilly.com/library/view/the-past-present/9781449343545/)
- John Dalziel, [The race for speed part 4: The future for JavaScript](http://creativejs.com/2013/06/the-race-for-speed-part-4-the-future-for-javascript/)
- Axel Rauschmayer, [Basic JavaScript for the impatient programmer](http://www.2ality.com/2013/06/basic-javascript.html)
- resin.io, [Happy 18th Birthday JavaScript! A look at an unlikely past and bright future](http://resin.io/happy-18th-birthday-javascript/)
- Axel Rauschmayer, [Basic JavaScript for the impatient programmer](https://www.2ality.com/2013/06/basic-javascript.html)
- balena.io, [Happy 18th Birthday JavaScript! A look at an unlikely past and bright future](https://www.balena.io/blog/happy-18th-birthday-javascript/)
7 changes: 4 additions & 3 deletions docs/bom/arraybuffer.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ myBlob.type // "text/html"
`Blob`具有一个实例方法`slice`,用来拷贝原来的数据,返回的也是一个`Blob`实例。

```javascript
myBlob.slice(startend, contentType)
myBlob.slice(start, end, contentType)
```

`slice`方法有三个参数,都是可选的。它们依次是起始的字节位置(默认为0)、结束的字节位置(默认为`size`属性的值,该位置本身将不包含在拷贝的数据之中)、新实例的数据类型(默认为空字符串)。
Expand Down Expand Up @@ -164,8 +164,8 @@ FileReader 对象提供四个方法,处理 Blob 对象。Blob 对象作为参

```javascript
// HTML 代码如下
// <input type=file' onchange='readfile(this.files[0])'></input>
// <pre id='output'></pre>
// <input type="file" onchange="readfile(this.files[0])"></input>
// <pre id="output"></pre>
function readfile(f) {
var reader = new FileReader();
reader.readAsText(f);
Expand Down Expand Up @@ -210,3 +210,4 @@ function typefile(file) {
};
}
```

Loading