17 February 2021

var example in javascript

Var: The var statement is used to declares a variable in JavaScript. 

 JavaScript Code:

var myName='Adi';

console.log(myName);


myName='JC';

console.log(myName);

Output:

"Adi"
"JC"

No comments:

Post a Comment