javascript-tutorial / javascript-tutorial/en.javascript.info

Clarify Explanation of Function Expressions in JavaScript Tutorial

未關閉
#3,776 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

主要語言
HTML
星號
25.5k
分支
4k
PR 合併指標
30 天內沒有已合併 PR

描述

Description: The section of the tutorial discussing function expressions could benefit from a clearer distinction between Function Declarations and Function Expressions. Currently, the wording may cause confusion by implying that a Function Declaration creates a "variable" to hold the function name, which isn’t technically accurate.

Suggested Changes: In the tutorial, this line:

"The Function Declaration (1) creates the function and puts it into the variable named sayHi."

Might be more accurately phrased as:

"The Function Declaration (1) creates a function with the name sayHi. Unlike a Function Expression, this doesn’t involve a variable assignment."

This change would help learners understand that sayHi in this example is the function’s name from the declaration, rather than a variable containing the function reference.

Additional Context: I initially misunderstood this as creating a variable. I believe this clarification would prevent similar confusion for others. Thanks for considering this suggestion!

See screenshot attached
![1](https://github.com/user-attachments/assets/24692818-6d57-412b-b112-8a48042c43d2)

貢獻指南

這個儲存庫沒有索引到貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

從 JavaScript 教學中關於 Function Expressions 的部分開始,找到將 Function Declarations 與變數指派進行比較的引文句子。更新措辭,以區分宣告的函式名稱與 Function Expression 的變數指派,然後檢查轉譯後的教學是否清楚。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
javascript
領域
documentation
Issue 類型
文件
難度
1/5
預估耗時
1 小時以內
活躍度
停滯
描述清晰度
描述清楚
新手友好度
55/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。