I can read and write some JavaScript
, but today I came across a .js
file starting with
!function() {
/*
code here
*/
}.call(window);
Question
what does !
infront of function
means?
I can read and write some JavaScript
, but today I came across a .js
file starting with
!function() {
/*
code here
*/
}.call(window);
Question
what does !
infront of function
means?
It returns "not" (!) of the result of a calling the anonymous function with a "this" of window.
Negating the result of .call(window)
. Not the function.