What does the exclamation mark do before the function?

后端 未结 9 1874
误落风尘
误落风尘 2020-11-21 04:47
!function () {}();
9条回答
  •  说谎
    说谎 (楼主)
    2020-11-21 04:56

    Its another way of writing IIFE (immediately-invoked function expression).

    Its other way of writing -

    (function( args ) {})()
    

    same as

    !function ( args ) {}();
    

提交回复
热议问题