Javascript


Related applications


Search a word:
   



© The scientific sentence. 2010


Variables




A semicolon at the end of line containing an executable statement 
is optional, but good practice; and above all, makes it possible 
to write multiple statements on one line. 

They have to be declared first as:
var a; 

var A; 
var temperature;
var z;

Variables can hold values like:
a = 23; 
A = 23; 
temperature = 50.57;
z = "Result";
or expressions like:
x = a + A + temperature;
z = a + A;

After the execution: document.write(x); , 
and document.write(z);  , the output will be:

x = 96.57
Result = 46

We can assign values to the variables during the 
declaration, as:
var temperature = 50.57;
var z = "Result";
In this case, the variables (temperature and z) will keep their 
values after execution.

JavaScript is case-sensitive (a and A are different variables), and 
variable names must begin with a letter or the underscore character.

  
Google
Web
ScientificSentence
 




chimie labs
|
scientific sentence
|
java
|
php
|
green cat
|
contact
|


© Scientificsentence 2009. All rights reserved.