Javascript Statements

 

java script statements 

Statements are the instructions to the interpreter to carry out specific actions. We have many statement, one of the most common statements is an assignment. Assignment uses the = operator and places the value on the right-hand side into the variable on the left.

a=b+20;

in the above statement, we add 20  to the b and places the value in a. The assignment operator should not be confused with the “is equal to “ comparison operator == , which is used in conditional expressions.

Semicolons :-

Semicolons indicates the end of javascript statement. We can add multiple statement in a single line.

a=a+1;    b=b+2;    c=c+40;

 

Blocks :-

Curly braces  “{   }” are used to group a list of statements together. The statements that make up the body of a function are enclosed in curly braces :

function sum(a, b)

{

var  result =a+b;

return  result ;

}




Follow Us

Contact Us

tutorialworldin@yahoo.com

Back to Top