Javascript hoisting example

Octocat **Promotion** - Efficiently manage your coding bookmarks, aka #codingmarks, on and share your hidden gems with the world. They are published weekly on Github. You can help us build THE programming-resources location - Star

<title>Hoisting example</title>
    <h1>Hoisting in action</h1>
    <script type="application/javascript">
        var hoisting = "global variable";
            confirm("\"" + hoisting + "\"" + " click OK" );
            var hoisting = "local variable";
        })(); //self-executing function 

     //Best practice - declare local variables at the beginning of the function 

New codingmarks added in the 12th week of 2018

New codingmarks added in the 12th week of 2018. Keywords: angular, arquillian, debugging, ecmascript-6, free-programming-books, http, intellij, java, javaee, javascript, jsonp, maven, npm, rxjs, testing, unit-testing and user-experience Continue reading