What is this type of syntax called in javascript?

 (function(){})()

and this

  !function(){}()

I'd like to do a search to learn about them but I don't know what I'm searching for.

Also if anyone can provide link to a useful recourse that would be great.

有帮助吗?

解决方案

This is the syntax for IIFE (Immediately Invoked Functions in Javascript).

This is a great article that should clear all your doubts:

http://benalman.com/news/2010/11/immediately-invoked-function-expression/

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top