-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[js] 第235天 请写出几种匿名自执行的写法(至少三种) #1614
Labels
js
JavaScript
Comments
正好是昨天看到的 |
(function () { console.log('自执行函数1'); })();
(function () { console.log('自执行函数2'); }());
!function () { console.log('自执行函数3'); }();
+ function () {
console.log('自执行函数4');
}();
- function () {
console.log('自执行函数5');
}();
~function () {
console.log('自执行函数6');
}();
!function () {
console.log('自执行函数7');
}();
~~function () {
console.log('自执行函数8');
}();
!!function () {
console.log('自执行函数9');
}(); |
只要前面是表达式就可以自执行 |
(function(){ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
第235天 请写出几种匿名自执行的写法(至少三种)
我也要出题
The text was updated successfully, but these errors were encountered: