在JS代码中使用命名IIFE来描述和分组相关代码的优缺点是什么?我一直在使用这种“模式”为我的更多过程代码提供结构,这些代码只在一个地方执行。例子(functionhideStuffOnInstantiaton(){$('oneThing').hide().removeClass();$('#somethign_else').slideUp();$('.foo').fadeOut();}());我发现这比两者更可取://hideStuffonInstantiaton$('oneThing').hide().removeClass();$('#somethign_else').slide