what does `!function()` mean?

This question already has an answer here:

  • What does the exclamation mark do before the function? 9 answers

  • The preceding ! takes the un-parseable statement, and allows it to to be parsed by the JS engine, which in turn returns true.

    function(){}();
    SyntaxError: Unexpected token (
    
    !function(){}();
    >>true
    

    Source

    链接地址: http://www.djcxy.com/p/96896.html

    上一篇: 什么!功能($){$(功能(){})}(window.jQuery)做什么?

    下一篇: `!function()`是什么意思?