what does !function in Javascript mean? (ok)
https://stackoverflow.com/questions/9267289/what-does-function-in-javascript-mean
41
It is short-hand or alternative of self-invoking anonymous function:
(function(){
// code
})();Can be written:
!function(){
// code
}();You can also use + instead of !.
If you simply did:
function(){
// code
}();That will create problems, that's why you need to add ! before it which turns the function declaration into function expression.
Đọc thêm bài này: https://app.gitbook.com/@javascriptuse/s/advanced/javascript-self-invoking-functions-ok
PreviousPhát hiện phần tử xuất hiện ở màn hình, Detect element appearing on screen, view (ok)Next[WEBPACK] Một cách phân biệt khi bundle ra es5 hay es6 một ví dụ sử dụng webpack (ok)
Last updated
Was this helpful?