Classes are not hoisted!

You can call a function before it's defined; that is, function calls can be made before the function definition. But, you cannot use a class before it's defined. Trying to do so in classes will throw the ReferenceError exception.

Here is an example to demonstrate this:

myFunc(); // fine
function myFunc(){}
var obj = new myClass(); // throws error
class myClass {}
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.17.191.118