![](/img/trans.png)
[英]It is good practice to use name=arguments as function arguments in arrow functions?
[英]Is it good practice to define a function with different arguments list from reference in javascript?
例如,我使用的框架會調用自定義 function,如下所示:
var ret = Module_Init(index, clk, obj);
function Module_Init
應由用戶定義。 而在我的Module_Init
中,我只需要第一個參數index
。 所以我這樣定義它:
function Module_Init(index)
{
m_Index = index;
// initialize code...
}
它有效,但在 Javascript 中這是一個好習慣嗎?
如果您不打算使用它們,為什么將它們放在 function 中
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.