Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(zh): maintain redirected links (part 2) #22802

Merged
merged 9 commits into from
Aug 1, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ console.log("John's cat".length);
// In this case, 10.
```

In ES2015, template literals are also available. Template literals are enclosed by the back-tick (\` \`) ([grave accent](http://en.wikipedia.org/wiki/Grave_accent)) character instead of double or single quotes. Template strings provide syntactic sugar for constructing strings. This is similar to string interpolation features in Perl, Python and more. Optionally, a tag can be added to allow the string construction to be customized, avoiding injection attacks or constructing higher level data structures from string contents.
In ES2015, template literals are also available. Template literals are enclosed by the back-tick (\` \`) ([grave accent](https://en.wikipedia.org/wiki/Grave_accent)) character instead of double or single quotes. Template strings provide syntactic sugar for constructing strings. This is similar to string interpolation features in Perl, Python and more. Optionally, a tag can be added to allow the string construction to be customized, avoiding injection attacks or constructing higher level data structures from string contents.
yin1999 marked this conversation as resolved.
Show resolved Hide resolved

```js
// Basic literal string creation
Expand Down
4 changes: 2 additions & 2 deletions files/zh-tw/web/javascript/guide/introduction/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ Java 是一個為了快速執行與安全型態而設計的基於類別的程式

## JavaScript 與 ECMAScript 規格

Netscape 公司發明了 JavaScript ,而 JavaScript 的第一次應用正是在 Netscape 瀏覽器。然而,Netscape 後來和 [Ecma International](http://www.ecma-international.org/)(一個致力於將資訊及通訊系統標準化的歐洲組織,前身為 ECMA - 歐洲計算機製造商協會)合作,開發一個基於 JavaScript 核心並同時兼具標準化與國際化的程式語言,這個經過標準化的 JavaScript 便稱作 ECMAScript ,和 JavaScript 有著相同的應用方式並支援相關標準。各個公司都可以使用這個開放的標準語言去開發 JavaScript 的專案。ECMAScript 標準記載於 ECMA-262 這個規格中。
Netscape 公司發明了 JavaScript ,而 JavaScript 的第一次應用正是在 Netscape 瀏覽器。然而,Netscape 後來和 [Ecma International](https://ecma-international.org/)(一個致力於將資訊及通訊系統標準化的歐洲組織,前身為 ECMA - 歐洲計算機製造商協會)合作,開發一個基於 JavaScript 核心並同時兼具標準化與國際化的程式語言,這個經過標準化的 JavaScript 便稱作 ECMAScript ,和 JavaScript 有著相同的應用方式並支援相關標準。各個公司都可以使用這個開放的標準語言去開發 JavaScript 的專案。ECMAScript 標準記載於 ECMA-262 這個規格中。

ECMA-262 標準同時也經過 [ISO](http://www.iso.ch/)(國際標準化組織)認証,成為 ISO-16262 標準。你可以在 Mozilla 的網站上找到 [PDF 版本的 ECMA-262](http://www-archive.mozilla.org/js/language/E262-3.pdf),但這板本已過期;你也可以在 [Ecma International 的網站](http://www.ecma-international.org/publications/standards/Ecma-262.htm) 找到這個規格。 ECMAScript 規格中並沒有描述已經被 W3C(全球資訊網協會)標準化的文件物件模型(DOM)。文件物件模型定義了 HTML 文件物件(document objects)和腳本之間運作的方式。
ECMA-262 標準同時也經過 [ISO](https://www.iso.org/home.html)(國際標準化組織)認証,成為 ISO-16262 標準。你可以在 Mozilla 的網站上找到 [PDF 版本的 ECMA-262](https://www-archive.mozilla.org/js/language/E262-3.pdf),但這板本已過期;你也可以在 [Ecma International 的網站](https://ecma-international.org/publications/standards/Ecma-262.htm) 找到這個規格。 ECMAScript 規格中並沒有描述已經被 W3C(全球資訊網協會)標準化的文件物件模型(DOM)。文件物件模型定義了 HTML 文件物件(document objects)和腳本之間運作的方式。

### JavaScript 版本與 ECMAScript 版本之間的關係

Expand Down
yin1999 marked this conversation as resolved.
Show resolved Hide resolved
yin1999 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ var re = new RegExp("ab+c");
| [`[xyz]`](#special-character-set) | 字元的集合。此格式會匹配中括號內所有字元, including [escape sequences](/zh-TW/docs/JavaScript/Guide/Values,_variables,_and_literals#Unicode_escape_sequences)。特殊字元,例如點(`.`) 和米字號(`*`),在字元集合中不具特殊意義,所以不需轉換。若要設一個字元範圍的集合,可以使用橫線 `"-"` ,如下例所示: `[a-d]` 等同於 `[abcd]。`會匹配 "brisket" 的 "b" 、"city" 的 'c' ……等。 而`/[a-z.]+/` 和 `/[\w.]+/` 均可匹配字串 "test.i.ng" 。 |
| [`[^xyz]`](#special-negated-character-set) | bracket 中寫入的字元將被否定,匹配非出現在 bracket 中的符號。 可用 '-' 來界定字元的範圍。一般直接表達的符號都可以使用這種方式。`[^abc]`可以寫作\[^`a-c]`. "brisket" 中找到 'r' 、"chop."中找到 'h'。 |
| [`[\b]`](#special-backspace) | 吻合倒退字元 (U+0008). (不會跟 \b 混淆) |
| [`\b`](#special-word-boundary) | 吻合文字邊界。A word boundary matches the position where a word character is not followed or preceded by another word-character. Note that a matched word boundary is not included in the match. In other words, the length of a matched word boundary is zero. (Not to be confused with `[\b]`.)Examples: `/\bm/` matches the 'm' in "moon" ; `/oo\b/` does not match the 'oo' in "moon", because 'oo' is followed by 'n' which is a word character; `/oon\b/` matches the 'oon' in "moon", because 'oon' is the end of the string, thus not followed by a word character; `/\w\b\w/` will never match anything, because a word character can never be followed by both a non-word and a word character.**Note:** JavaScript's regular expression engine defines a [specific set of characters](http://www.ecma-international.org/ecma-262/5.1/#sec-15.10.2.6) to be "word" characters. Any character not in that set is considered a word break. This set of characters is fairly limited: it consists solely of the Roman alphabet in both upper- and lower-case, decimal digits, and the underscore character. Accented characters, such as "é" or "ü" are, unfortunately, treated as word breaks. |
| [`\b`](#special-word-boundary) | 吻合文字邊界。A word boundary matches the position where a word character is not followed or preceded by another word-character. Note that a matched word boundary is not included in the match. In other words, the length of a matched word boundary is zero. (Not to be confused with `[\b]`.)Examples: `/\bm/` matches the 'm' in "moon" ; `/oo\b/` does not match the 'oo' in "moon", because 'oo' is followed by 'n' which is a word character; `/oon\b/` matches the 'oon' in "moon", because 'oon' is the end of the string, thus not followed by a word character; `/\w\b\w/` will never match anything, because a word character can never be followed by both a non-word and a word character.**Note:** JavaScript's regular expression engine defines a [specific set of characters](https://262.ecma-international.org/5.1/#sec-15.10.2.6) to be "word" characters. Any character not in that set is considered a word break. This set of characters is fairly limited: it consists solely of the Roman alphabet in both upper- and lower-case, decimal digits, and the underscore character. Accented characters, such as "é" or "ü" are, unfortunately, treated as word breaks. |
| [`\B`](#special-non-word-boundary) | 吻合非文字邊界。This matches a position where the previous and next character are of the same type: Either both must be words, or both must be non-words. The beginning and end of a string are considered non-words.For example, `/\B../` matches 'oo' in "noonday", and `/y\B./` matches 'ye' in "possibly yesterday." |
| [`\cX`](#special-control) | Where _X_ is a character ranging from A to Z. Matches a control character in a string.For example, `/\cM/` matches control-M (U+000D) in a string. |
| [`\d`](#special-digit) | 吻合數字,寫法等同於 `[0-9] 。`例如:`/\d/` 或 `/[0-9]/` 在 "B2 is the suite number." 中找到 '2' |
Expand Down
4 changes: 2 additions & 2 deletions files/zh-tw/web/javascript/guide/typed_arrays/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ var amountDueView = new Float32Array(buffer, 20, 1);

舉例來說,可以用 `amountDueView[0]` 存取 amountDue。

> **備註:** C 結構的 [data structure alignment](http://en.wikipedia.org/wiki/Data_structure_alignment) 是與使用平台有關,須小心這些填充上的差異。
> **備註:** C 結構的 [data structure alignment](https://en.wikipedia.org/wiki/Data_structure_alignment) 是與使用平台有關,須小心這些填充上的差異。

### Conversion to normal arrays

Expand All @@ -157,5 +157,5 @@ normalArray.constructor === Array;
- [Getting `ArrayBuffer`s or typed arrays from _Base64_-encoded strings](/zh-TW/docs/Web/JavaScript/Base64_encoding_and_decoding#Appendix.3A_Decode_a_Base64_string_to_Uint8Array_or_ArrayBuffer)
- [`StringView` – a C-like representation of strings based on typed arrays](/zh-TW/docs/Code_snippets/StringView)
- [Faster Canvas Pixel Manipulation with Typed Arrays](https://hacks.mozilla.org/2011/12/faster-canvas-pixel-manipulation-with-typed-arrays)
- [Typed Arrays: Binary Data in the Browser](http://www.html5rocks.com/en/tutorials/webgl/typed_arrays)
- [Typed Arrays: Binary Data in the Browser](https://www.html5rocks.com/en/tutorials/webgl/typed_arrays)
- {{Glossary("Endianness")}}
6 changes: 3 additions & 3 deletions files/zh-tw/web/javascript/guide/using_promises/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ async function foo() {
}
```

這基於 Promise,例如 `doSomething()` 和之前一樣。你可以閱讀在[這裡](https://developers.google.com/web/fundamentals/getting-started/primers/async-functions)閱讀更多。
這基於 Promise,例如 `doSomething()` 和之前一樣。你可以閱讀在[這裡](https://web.dev/)閱讀更多。
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the link was no longer maintained on google.com, and was redircted to web.dev's homepage

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not agree with the change here. The page https://web.dev/ does not provide any information about Promise.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeap, while the original link neither - also the link was removed in mdn/content

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
這基於 Promise,例如 `doSomething()` 和之前一樣。你可以閱讀在[這裡](https://web.dev/)閱讀更多。
這基於 Promise,例如 `doSomething()` 和之前一樣。你可以閱讀在[這裡](http://web.archive.org/web/20170808153026/https://developers.google.com/web/fundamentals/getting-started/primers/async-functions)閱讀更多。

Copy link
Contributor Author

@PassionPenguin PassionPenguin Jul 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or else this: https://web.dev/articles/async-functions

Suggested change
這基於 Promise,例如 `doSomething()` 和之前一樣。你可以閱讀在[這裡](https://web.dev/)閱讀更多。
這基於 Promise,例如 `doSomething()` 和之前一樣。你可以閱讀在[這裡](https://web.dev/articles/async-functions)閱讀更多。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


Promise 藉由捕捉所有錯誤,包含例外和程式錯誤,解決了 Callback 地獄的缺點。這是非同步運算的基本特性。

Expand Down Expand Up @@ -283,8 +283,8 @@ console.log(1); // 1, 2, 3, 4
## 看更多

- {{jsxref("Promise.then()")}}
- [Promises/A+ 特色](http://promisesaplus.com/)
- [Promises/A+ 特色](https://promisesaplus.com/)
- [Venkatraman.R - JS Promise (Part 1, Basics)](https://medium.com/@ramsunvtech/promises-of-promise-part-1-53f769245a53)
- [Venkatraman.R - JS Promise (Part 2 - Using Q.js, When.js and RSVP.js)](https://medium.com/@ramsunvtech/js-promise-part-2-q-js-when-js-and-rsvp-js-af596232525c#.dzlqh6ski)
- [Venkatraman.R - Tools for Promises Unit Testing](https://tech.io/playgrounds/11107/tools-for-promises-unittesting/introduction)
- [Nolan Lawson: We have a problem with promises — Common mistakes with promises](http://pouchdb.com/2015/05/18/we-have-a-problem-with-promises.html)
- [Nolan Lawson: We have a problem with promises — Common mistakes with promises](https://pouchdb.com/2015/05/18/we-have-a-problem-with-promises.html)
Loading
Loading