How to using ES6 Arrow function to realize Immediately-Invoked Function Expression (IIFE))? [closed]
How to using ES6 Arrow function to realize IIFE Immediately-Invoked Function Expression ? Here is my demo codes, and it had tested passed! // ES 6 + IIFE (() => { let b = false; console.log(`b === ${b}!`); const print = `print()`; if(window.print){ b = true; console.log(`b === ${b}!`); } let x = () => { if(b){ console.log(`Your browser support ${print} method.`); }else{ alert(`Your browser does not support ${print} method.`); console.log(`Your browser does not support ${print} method.`); }; } x(); })(); const dcs = `IIFE: Douglas Crockford's style`; // ES 5 + IIFE is OK (function(){ alert(