top button
Flag Notify
Site Registration

What is block scoping in Javascript ?

0 votes
262 views
What is block scoping in Javascript ?
posted Apr 25, 2018 by anonymous
Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

Block scope is everything inside a set of braces In Javascript Let is a block scoping.

Example:

if (true) {
let siteName = QueryHome;
document.write(siteName + "is a Q2A Platform")
}

where let scope is only with in the if statement.

answer Apr 25, 2018 by Aarati Mahajan

Your answer

Preview

Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.
...