February 2018
Intermediate to advanced
298 pages
8h 22m
English
Hoisting is JavaScript's default behavior: moving declarations to the top. That means the following code will work in JavaScript:
bookName("ES8 Concepts");function bookName(name) { console.log("I'm reading " + name);}
If you're coming from a C/C++ background, this might seem a little weird at first because those languages do not allow you to call a function before at least declaring its prototype. But JavaScript, behind the scenes, hoists the function, that is, all function declarations are moved to the top of the context. So, essentially, the preceding code is the same as the following:
function bookName(name) { console.log("I'm reading " + name);}bookName("ES8 Concepts");
Hoisting only moves the declarations to the top, not the ...
Read now
Unlock full access