JavaScript_03 - Variables and Operators

JavaScript variable are the basic building blocks the javascript programming. A variable is a memory location which assigns a value to it whenever your declare a variable.
javascript variables are like containers in the memory of the computer,
when we declare a variable it select a random memory location and give it the name that the user provides, and when a value is assigned to that variable , that value is stored to that memory location.

So lets see how the variables are declared.

A variable in javascript is created using the keyword 'var'.
Consider the following code snippet:

<html>

<head>
<title>codeMystery</title>
<center><h1>JavaScript Variables, types and operators</h1></center>

<script type="text/javascript" >
    var _newVar2, newVar3 = 45, z;
    _newVar2 = 45.78;
    //alert(_newVar2);
    document.write(_newVar2);
   
    alert(typeof(_newVar2));
</script>

</head>
<body>
</body>

</html>

Download here: https://www.file-upload.com/bpljo3jyjqpj

 

Comments

Popular Posts