If you have any query feel free to chat us!
Happy Coding! Happy Learning!
let
is a keyword in JavaScript that allows you to declare a block-scoped variable that can be reassigned. This means that you can use the same variable name for different values in different parts of your code without the values interfering with each other.
Here's an example:
javascriptCopy code
let x = 10;
if (true) {
let x = 20;
console.log(x); // output: 20
}
console.log(x); // output: 10
In this example, we declare a variable x
with the value of 10
. Then, we use let
to declare another variable x
inside an if
statement with the value of 20
. When we log the value of x
inside the if
statement, we get 20
. When we log the value of x
outside the if
statement, we get 10
, which is the original value of x
. This demonstrates how let
allows us to use the same variable name for different values in different parts of our code without the values interfering with each other.
Comments: 2
I am not able to access videos from second class and further. I have already completed first class
When will I get my course?
Now, Your query was resolved.