自执行函数如何传递参数

1 (function( abc ) {
2 console.log(abc) // ==> 1231
3 })( 1231 );
4 
5 (function(window){
6 console.log(window) // ==> Window {speechSynthesis: SpeechSynthesis, caches: CacheStorage, localStorage: Storage, sessionStorage: Storage, webkitStorageInfo: DeprecatedStorageInfo…}
7 })(window)

 

posted @ 2021-05-15 23:22  一个动态类型的幽灵  阅读(294)  评论(0编辑  收藏  举报