문제

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