Wednesday, August 18, 2021

Let, Const and Var Using in Javascript

 Let - let used in Javascript to create a variable which value we will change in later in our Programme.

  let myAge; // Declare the variable

  myAge = 31; // assign value to variable in later

Const - const also used in javascript for create a variable but this value can not be changed after declare this.

 ex. const myFirstName = 'Suhas'; // We can not change this value in our programme.

Var - var also used in javascript to create a variable but its old style now in modern way we use let and const to create variable.

0 comments

Post a Comment