Home  >  Article  >  Web Front-end  >  JavaScript立即执行函数的三种不同写法_javascript技巧

JavaScript立即执行函数的三种不同写法_javascript技巧

WBOY
WBOYOriginal
2016-05-16 16:37:121541browse

第一种:

(function () { // open IIFE 
// inside IIFE 
}()); // close IIFE

第二种:

!function () { // open IIFE 
// inside IIFE 
}(); // close IIFE

第三种:

void function () { // open IIFE 
// inside IIFE 
}(); // close IIFE
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn