Parenthesis for anonymous JavaScript functions

后端 未结 3 1338
忘掉有多难
忘掉有多难 2020-12-20 23:45

Are they the same?

var multiply = function () {
      //..
      }();

var multiply1 = (function () {
      //..
      }());
3条回答
  •  萌比男神i
    2020-12-21 00:11

    As mquander said in that case they are the same, but if you want to read a little more about it you can go to: An Important Pair of Parens.

提交回复
热议问题