2

Javascript初心者です。モジュールパターンを読みながら。関数スコープ内に括弧があるこの無名関数に気付きました。私はこれを使用したことがありません。私はそれをよりよく理解したいと思います。

// first example
(function(){
    //this is IIFE I always use to avoid globle var. I think the simple form of this is F();
})();

// second example
(function () {
    //However, what is this concept? what's the formal name of this function? 
}());

これら2つの主な違いは何ですか? 2番目の例をどのように理解しますか?

4

1 に答える 1