Skip to content

Commit 69ad504

Browse files
committed
Merge pull request BonsaiDen#225 from lolikung/master
fix typo
2 parents 229707f + 30d2c58 commit 69ad504

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed

doc/zhtw/core/undefined.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,11 @@ JavaScript 中有兩個表示空值的方式, `null` 和 `undefined` , `unde
4343

4444
})('Hello World', 42);
4545

46-
唯一的不同就是在下者會多 4 個多 bytes 用來壓縮檔案,而且函數內野沒有其他需要使用 `var`
46+
唯一的不同就是在下者會多 4 個多 bytes 用來壓縮檔案,而且函數內也沒有其他需要使用 `var`
4747

4848
### 使用 `null`
4949

5050
JavaScript 中所使用的 `undefined` 類似別的語言中的 *null* , 但實際上在 JavaScript 中的 `null` 算是另外一個類型。
5151

5252
它在 JavaScript 有些可以使用的地方 (例如說宣告一個原型的終結,例如 `Foo.prototype = null` )。
5353
但是在大部分的時候可以用 `undefined`,來取代。
54-
55-

doc/zhtw/other/timeouts.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
clearTimeout(i);
7474
}
7575

76-
可能還有一些定石器不會在上面的代碼中被清除,因此我們可以事先保存所有的定時器 ID,然後一把清除。
76+
可能還有一些定時器不會在上面的代碼中被清除,因此我們可以事先保存所有的定時器 ID,然後一把清除。
7777

7878

7979
// clear "all" timeouts
@@ -105,15 +105,15 @@ This feature should **never** be used because it internally makes use of `eval`.
105105
}
106106
bar();
107107

108-
Since `eval` is not getting called [directly](#core.eval) in this case, the string
109-
passed to `setTimeout` will be executed in the *global scope*; thus, it will
108+
Since `eval` is not getting called [directly](#core.eval) in this case, the string
109+
passed to `setTimeout` will be executed in the *global scope*; thus, it will
110110
not use the local variable `foo` from the scope of `bar`.
111111

112112
It is further recommended to **not** use a string to pass arguments to the
113-
function that will get called by either of the timeout functions.
113+
function that will get called by either of the timeout functions.
114114

115115
function foo(a, b, c) {}
116-
116+
117117
// NEVER use this
118118
setTimeout('foo(1, 2, 3)', 1000)
119119

@@ -122,19 +122,18 @@ function that will get called by either of the timeout functions.
122122
foo(a, b, c);
123123
}, 1000)
124124

125-
> **Note:** While it is also possible to use the syntax
125+
> **Note:** While it is also possible to use the syntax
126126
> `setTimeout(foo, 1000, a, b, c)`, it is not recommended, as its use may lead
127-
> to subtle errors when used with [methods](#function.this).
127+
> to subtle errors when used with [methods](#function.this).
128128
129129
### In Conclusion
130130

131-
A string should **never** be used as the parameter of `setTimeout` or
132-
`setInterval`. It is a clear sign of **really** bad code, when arguments need
131+
A string should **never** be used as the parameter of `setTimeout` or
132+
`setInterval`. It is a clear sign of **really** bad code, when arguments need
133133
to be supplied to the function that gets called. An *anonymous function* should
134134
be passed that then takes care of the actual call.
135135

136136
Furthermore, the use of `setInterval` should be avoided because its scheduler is not
137137
blocked by executing JavaScript.
138138

139139
[1]: http://en.wikipedia.org/wiki/Document_Object_Model "Document Object Model"
140-

0 commit comments

Comments
 (0)