JavaScript by Patrik

Hoisting of let

Just like varlet declarations are hoisted to the top. Unlike var which is initialized as undefined, the let keyword is not initialized. So if you try to use a let variable before the declaration, you'll get a Reference Error.

Comments

Leave a Comment

All fields are required. Your email address will not be published.