Virtual Open Schooling Online courses available at Virtual Open Schooling (VOS), for more details kindly click here!
NIOS Silver Jubilee Year
NIOS

Difference between revisions of "List of operators used in JavaScript"

From NIOS
Jump to: navigation, search
m
 
Line 1: Line 1:
 
{| class="wikitable" style="float:right;margin:1em;width:300px;"
 
{| class="wikitable" style="float:right;margin:1em;width:300px;"
 
|-
 
|-
! [[Variables in Java Script|Previous Page]] !! [[ICT-Application| Home Page]] !! [[Looping Constructs|Next Page]]
+
! [[Variables in JavaScript|Previous Page]] !! [[ICT-Application| Home Page]] !! [[Looping Constructs|Next Page]]
 
|-
 
|-
 
|}<div  style="text-align:center;font-weight:bold;padding:0.4em 1em 0.3em 1em;-moz-border-radius: 6px;background-color:#47b8b8; ">ICT Applications</div>
 
|}<div  style="text-align:center;font-weight:bold;padding:0.4em 1em 0.3em 1em;-moz-border-radius: 6px;background-color:#47b8b8; ">ICT Applications</div>
 
===<font color=green>Operators</font>===  
 
===<font color=green>Operators</font>===  
  
An operator is used to transform one or more values into a singleresultant value. In JavaScript, operators are used in expressions tostore or return a value.
+
An operator is used to transform one or more values into a single resultant value. In JavaScript, operators are used in expressions to store or return a value.
  
 
JavaScript operators are classified as:
 
JavaScript operators are classified as:
Line 23: Line 23:
  
  
An operator operates on operand or operands. The combination of oneor more operators is referred to as an expression.
+
An operator operates on operand or operands. The combination of one or more operators is referred to as an expression.
  
  
 
For example: netPayment=netPrice+salesTax
 
For example: netPayment=netPrice+salesTax
  
In this example “+” operator operates on operand netPrice andsales Tax and its result assigned to variable net Payment.
+
In this example “+” operator operates on operand netPrice and salesTax and its result assigned to variable net Payment.
  
 
The following table shows the list of operators used in JavaScript:
 
The following table shows the list of operators used in JavaScript:
  
[[File:javascript3.png|center|Java Script Operators|800px]]
+
[[File:javascript3.png|center|JavaScript Operators|800px]]
  
 
===<font color=green> Expressions</font>===
 
===<font color=green> Expressions</font>===
  
An expression is a part of statement that is evaluated as value.An expression can be any combination of variables, operators andother expressions. In JavaScript there are four types ofexpressions:
+
An expression is a part of statement that is evaluated as value.An expression can be any combination of variables, operators and other expressions. In JavaScript there are four types of expressions:
 
* Assignment expression
 
* Assignment expression
 
* Arithmetic expression
 
* Arithmetic expression
 
* String expression
 
* String expression
*Logical expression
+
* Logical expression
 
* Assignment expression
 
* Assignment expression
  
This expression is used to assign a value to a variable.Example: avgMarks=55, the value 55 has been assigned to thevariable avgMarks using assignment operator (=)
+
This expression is used to assign a value to a variable.Example: avgMarks=55, the value 55 has been assigned to the variable avgMarks using assignment operator (=)
 
====<font color=green>Arithmetic Expressions</font>====
 
====<font color=green>Arithmetic Expressions</font>====
Expressions in which arithmetic operations are performed arecalled arithmetic expression.Example: netPrice=1200+12
+
Expressions in which arithmetic operations are performed are called arithmetic expression.Example: netPrice=1200+12
 
====<font color=green>String Expression</font>====
 
====<font color=green>String Expression</font>====
Expressions in which operations are performed on string arecalled string expression.Example: mesg= "Hello," + "Mr. Rakesh", Here "+" string operatorconcatenate two strings "Hello, " and "Mr. Rakesh" results "Hello,Mr. Rakesh" that is assigned to variable mesg.
+
Expressions in which operations are performed on string are called string expression.Example: mesg= "Hello," + "Mr. Rakesh", Here "+" string operator concatenate two strings "Hello, " and "Mr. Rakesh" results "Hello,Mr. Rakesh" that is assigned to variable mesg.
 
====<font color=green>Logical Expression</font>====
 
====<font color=green>Logical Expression</font>====
These expressions evaluate to a Boolean (true or false) value.Example: 10<19, since 10<19, this expression evaluates to theBoolean value of true.
+
These expressions evaluate to a Boolean (true or false) value.Example: 10<19, since 10<19, this expression evaluates to the Boolean value of true.
  
 
{| class="wikitable" style="float:right;margin:1em;width:300px;"
 
{| class="wikitable" style="float:right;margin:1em;width:300px;"
 
|-
 
|-
! [[Variables in Java Script|Previous Page]] !! [[ICT-Application| Home Page]] !! [[Looping Constructs|Next Page]]
+
! [[Variables in JavaScript|Previous Page]] !! [[ICT-Application| Home Page]] !! [[Looping Constructs|Next Page]]
 
|-
 
|-
 
|}<div  style="text-align:center;font-weight:bold;padding:0.4em 1em 0.3em 1em;-moz-border-radius: 6px;background-color:#47b8b8; ">ICT Applications</div>
 
|}<div  style="text-align:center;font-weight:bold;padding:0.4em 1em 0.3em 1em;-moz-border-radius: 6px;background-color:#47b8b8; ">ICT Applications</div>
  
 
[[Category:TOPICS]]
 
[[Category:TOPICS]]

Latest revision as of 09:49, 2 March 2014

Previous Page Home Page Next Page
ICT Applications

Operators

An operator is used to transform one or more values into a single resultant value. In JavaScript, operators are used in expressions to store or return a value.

JavaScript operators are classified as:

* Arithmetic

* Logical

* Comparison

* String


An operator operates on operand or operands. The combination of one or more operators is referred to as an expression.


For example: netPayment=netPrice+salesTax

In this example “+” operator operates on operand netPrice and salesTax and its result assigned to variable net Payment.

The following table shows the list of operators used in JavaScript:

JavaScript Operators

Expressions

An expression is a part of statement that is evaluated as value.An expression can be any combination of variables, operators and other expressions. In JavaScript there are four types of expressions:

  • Assignment expression
  • Arithmetic expression
  • String expression
  • Logical expression
  • Assignment expression

This expression is used to assign a value to a variable.Example: avgMarks=55, the value 55 has been assigned to the variable avgMarks using assignment operator (=)

Arithmetic Expressions

Expressions in which arithmetic operations are performed are called arithmetic expression.Example: netPrice=1200+12

String Expression

Expressions in which operations are performed on string are called string expression.Example: mesg= "Hello," + "Mr. Rakesh", Here "+" string operator concatenate two strings "Hello, " and "Mr. Rakesh" results "Hello,Mr. Rakesh" that is assigned to variable mesg.

Logical Expression

These expressions evaluate to a Boolean (true or false) value.Example: 10<19, since 10<19, this expression evaluates to the Boolean value of true.

Previous Page Home Page Next Page
ICT Applications