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

範例程式碼註解錯誤 #25307

Open
lyuchan opened this issue Jan 2, 2025 · 1 comment
Open

範例程式碼註解錯誤 #25307

lyuchan opened this issue Jan 2, 2025 · 1 comment
Labels
good first issue A good issue for newcomers to get started with. l10n-zh Issues related to Chinese content.

Comments

@lyuchan
Copy link

lyuchan commented Jan 2, 2025

MDN URL

https://developer.mozilla.org/zh-TW/docs/Web/JavaScript/Reference/Functions/Default_parameters

與此問題相關的章節或標題?

No response

哪些資訊不正確、不實用或不完整?

文中範例程式碼當中輸出內容錯誤
原範例程式碼內容

function singularAutoPlural(
  singular,
  plural = singular + "們",
  rallyingCry = plural + ",進攻啊!!!",
) {
  return [singular, plural, rallyingCry];
}

//["壁虎","壁虎們", "壁虎,進攻啊!!!"]
singularAutoPlural("壁虎");

//["狐狸","火紅的狐狸們", "火紅的狐狸們,進攻啊!!!"]
singularAutoPlural("狐狸", "火紅的狐狸們");

//["鹿兒", "鹿兒們", "鹿兒們 ... 有所好轉"]
singularAutoPlural(
  "鹿兒",
  "鹿兒們",
  "鹿兒們平心靜氣的 \
   向政府請願,希望事情有所好轉。",
);

你預期看到什麼?

當中的

//["壁虎","壁虎們", "壁虎,進攻啊!!!"]
singularAutoPlural("壁虎");

應修正為

//["壁虎","壁虎們", "壁虎們,進攻啊!!!"]
singularAutoPlural("壁虎");

你有任何支援連結、參考文獻或引文嗎?

No response

還有什麼想補充的內容嗎?

No response

MDN metadata

Page report details
@lyuchan lyuchan added l10n-zh Issues related to Chinese content. needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. labels Jan 2, 2025
@jasonren0403 jasonren0403 removed the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Jan 2, 2025
@jasonren0403
Copy link
Contributor

jasonren0403 commented Jan 2, 2025

@jasonren0403 jasonren0403 added the good first issue A good issue for newcomers to get started with. label Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue A good issue for newcomers to get started with. l10n-zh Issues related to Chinese content.
Projects
Status: To do - Issues
Development

No branches or pull requests

2 participants