- Global scoping
- Functional scoping
- Lexical scoping
To explore let statement in detail, consider the code snippet given below:
You will get this output for the above code listing:
In the above listing, variable x is declared using the var statement. Hence, the scope of variable x is a function scope. Variable x inside the if statemnet is same variable x which was created outside the if statement. So, when you modify the value of variable x inside the if statement block, it modifies the value for all references of variable x in the function.
To avoid this, you need block-level scoping, and the let statement allows you to create a block-scoped local variable.
Let’s modify the above code snippet and use the let statement to declare the variable:
In the above code snippet, you are declaring scope level local variable x using the let statement. Therefore updating value of variable x inside the if statement will not affect value of variable x outside the if statement.
Read full article on the Infragistics blog
Since, I have recorded this video in Starbucks, there is some noise. I am sorry for that.
On behalf of Infragistics , I am hosting a free webinar on “Step by Step Getting Started with Angular 4”.
To attend register here .
I invite you to attend this webinar on 20 July 2017 Thursday at 11 AM. This is an opportunity for you to learn Angular 4 application development from comfort of your home or office cubicle. To attend the webinar, all you need is a laptop with good Internet connection.
Register now and learn step by step how to create your first Angular application. Not only will you get started with Angular and build your own app performing CRUD operations on REST API , you’ll also learn about many of Angular’s core concepts, including:
- How to create a project with Angular CLI
- components communications with @Input and @Output
- Services and Dependency Injection
- Working with $http, observable and more
When – 20 July 2017 starting 11 AM
Where – Attend from your office or hope using laptop and Internet
To attend register here
I am very happy and excited to share that once again I have received prestigious Microsoft Most Valuable Professional Award
First time I got Microsoft MVP award in 2010 in Connected System Development specialization. In 2015, my specialization got changed to ASP.NET/IIS and in 2016, it changed to Visual Studio and Development. Once again, in 2017, I got awarded in Visual Studio and Development technologies.
You get this award if contribute to developer communities and enable them in various ways such as
- Writing books
- Writing articles
- Writing blog posts
- Delivering free sessions, workshops etc.
- Answering questions in forums like Stackoverflow
- Contributing to open source projects
- Providing feedback to Microsoft products team etc.
Finally, I would like to thank many seniors who have been inspiring me to do better and each one of you for your support. I am aspired for being more useful to you.
Below it is I in front of my MVP award wall in my MVP Tshirt