Thursday, 12 October 2017

Immediately Invoked Function Expressions (IIFEs)



    <script>
        function XYZ() {
            alert('xyz');
        }

        XYZ();
    </script>

Can be written as

  

   <script>
        (function () {
            alert('xyz');
        })();
    </script>


No comments:

Post a Comment