What is “let” statement in JavaScript?

Using the let statement, you can create Block scoped local variables in JavaScript. The let statement was introduced in the ECMAScript 6 standard of JavaScript.

Before ECMAScript 6, JavaScript had three types of scoping:

  • 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:

image

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

Join free webinar on “Step by Step Getting Started with Angular 4”

On behalf of Infragistics , I am hosting a free webinar on “Step by Step Getting Started with Angular 4”.

To attend register here .

clip_image002

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
  • Modules
  • components communications with @Input and @Output
  • Services and Dependency Injection
  • Working with $http, observable and more

In addition, you’ll see first-hand how easy it is to build a responsive Angular application using Ignite UI for JavaScript Angular Components . You’ll leave the webinar with a thorough understanding of the core concepts of Angular that will have you creating your own Angular apps in no time!

When – 20 July 2017 starting 11 AM

Where – Attend from your office or hope using laptop and Internet

To attend register here

Thanks

DJ

Thanks Microsoft for awarding me Most Valuable Professional Award 8th times in a row

I am very happy and excited to share that once again I have received prestigious Microsoft Most Valuable Professional Award

image

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.

Since last few years, I have been working on JavaScript and Angular. Therefore, I am contributing to developer community around these technologies. To give you some idea in 2016 only, I hosted 19 free workshop on Angular in various Indian cities. Besides these workshops, written many blog posts on JavaScript and Angular.

My journey as Microsoft MVP was never possible without support from my amazing employer Infragistics. I work as Developer Evangelist for Infragistics and I urge you to check our amazing JavaScript product Ignite UI here.

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

image

Thanks

DJ