17 February 2021

const example in javascript

   const : The const statement is used to declares a variable in JavaScript. Let introduced from ES2015.

 JavaScript Code:

const  myName='Adi';

console.log(myName);


myName='JC';  //error

console.log(myName);

Output:

"Adi"
//error

No comments:

Post a Comment