Parenthesis for anonymous JavaScript functions

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

Are they the same?

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

var multiply1 = (function () {
      //..
      }());
3条回答
  •  轮回少年
    2020-12-20 23:51

    They seem to work the same here in Chrome: http://jsfiddle.net/jfriend00/G5DZp/

提交回复
热议问题