Academic Tutorials



English | French | Portugese | Dutch | Italian
Google

Online

À la maison Codes sources E-Livres Téléchargements Nous contacter Au sujet de nous

HTML Tutorials
HTML Tutorial
XHTML Tutorial
CSS Tutorial
TCP/IP Tutorial
XML Tutorials
XML Tutorial
XSL Tutorial
XSLT Tutorial
DTD Tutorial
Schema Tutorial
XForms Tutorial
XSL-FO Tutorial
XML DOM Tutorial
XLink Tutorial
XQuery Tutorial
XPath Tutorial
XPointer Tutorial
RDF Tutorial
SOAP Tutorial
WSDL Tutorial
RSS Tutorial
WAP Tutorial
Web Services Tutorial
Browser Scripting
JavaScript Tutorial
VBScript Tutorial
AJAX Tutorial
DHTML Tutorial
HTML DOM Tutorial
WMLScript Tutorial
E4X Tutorial
Server Scripting
ASP Tutorial
PHP Tutorial
PERL Tutorial
SQL Tutorial
ADO Tutorial
.NET (dotnet)
Microsoft.Net
XML Web Services
ASP.Net
.Net Mobile
C# : C Sharp
ADO.NET
VB.NET
Multimedia
SVG Tutorial
Flash Tutorial
Media Tutorial
SMIL Tutorial
Web Building
Web Browsers
Web Hosting
W3C Tutorial
Web Building
Web Quality
Web Semantic
Web Careers
Java Tutorials
Java Tutorial
JSP Tutorial
Servlets Tutorial
Struts Tutorial
EJB Tutorial
JMS Tutorial
JMX Tutorial
Programming Langauges
C Tutorial
C++ Tutorial
Visual Basic Tutorial
Data Structures Using C
Soft Skills
Communication Skills
Time Management
Project Management
Team Work
Leadership Skills
Corporate Communication
Negotiation Skills


Opérateur de Javascript
Previous Next



Le Javascript a les types suivants d'opérateurs. Dans cette section décrit les opérateurs et contient des informations sur la priorité d'opérateur.
Opérateurs de tâche
Opérateurs de comparaison
Opérateurs arithmétiques
Au niveau du bit opérateurs
Opérateurs logiques
Opérateurs de corde



Le Javascript a les types suivants d'opérateurs. Cette section décrit les opérateurs et contient des informations sur la priorité d'opérateur.

operand1 operator operand2


Par exemple, 3+4 ou x*y.

Un opérateur unaire a besoin d'un d'opérande unique, l'un ou l'autre avant ou après l'opérateur :


operator operand

Ou

operand operator


Par exemple, x++ ou ++x.

Le manuscrit de Java a un opérateur ternaire, l'opérateur conditionnel. Un opérateur ternaire a besoin de trois opérandes.




Priorité d'opérateur

 Operator type  Individual operators
 member  . []
 call / create instance  () new
 negation/increment  ! ~ - + ++ -- typeof void delete
 multiply/divide  * / %
 addition/subtraction  + -
 bitwise shift  << >> >>>
 relational  < <= > >= in instanceof
 equality  == != === !==
 bitwise-and  &
 bitwise-xor  ^
 bitwise-or  |
 logical-and  &&
 logical-or  ||
 conditional  ?:
 assignment  = += -= *= /= %= <<= >>= >>>= &= ^= |=
 comma  ,



Opérateurs de tâche

Par exemple, x++ ou ++x.

Un opérateur de tâche assigne une valeur à son opérande gauche basé sur la valeur de son bon opérande. L'opérateur de tâche de base est égal (=), qui assigne la valeur de son bon opérande à son opérande gauche. C'est-à-dire, x = y assigne la valeur de y à X.

Les autres opérateurs de tâche sont sténographie pour des opérations standard, suivant les indications de la table suivante.


 Shorthand operator  Meaning
 x += y  x = x + y
 x -= y  x = x - y
 x *= y  x = x * y
 x /= y  x = x / y
 x %= y  x = x % y
 x <<= y  x = x << y
 x >>= y  x >>= y
 x >>>= y  x = x >>> y
 x &= y  x = x & y
 x ^= y  x = x ^ y
 x |= y  x = x | y


Opérateurs de comparaison

Un opérateur de comparaison comparent ses opérandes et des retours qu'une valeur logique a basés dessus, que la comparaison soit vraie ou pas. Les opérandes peuvent être des valeurs numériques, de corde, logiques, ou d'objet. Des cordes sont comparées ont basé sur la commande lexicographique standard, en utilisant des valeurs d'Unicode. Si les deux opérandes ne sont pas du même type, le Javascript essaye de convertir les opérandes en type approprié pour la comparaison, excepté le === et ! opérateurs de ==. Ceci a généralement comme conséquence une comparaison numérique étant exécutée. La table suivante décrit les opérateurs de comparaison.



 Shorthand operator  Meaning
 x += y  x = x + y
 x -= y  x = x - y
 x *= y  x = x * y
 x /= y  x = x / y
 x %= y  x = x % y
 x <<= y  x = x << y
 x >>= y  x >>= y
 x >>>= y  x = x >>> y
 x &= y  x = x & y
 x ^= y  x = x ^ y
 x |= y  x = x | y


Bitwise Operators

Bitwise operators treat their operands as a set of 32 bits (zeros(0) and ones(1)), rather than as decimal, hexadecimal, or octal numbers. For example, the decimal number nine has a binary representation of 1001. Bitwise operators perform their operations on such binary representations, but they return standard Java Script numerical values.


Operator Description Example
== is equal to 5==8 returns false
=== is equal to (checks for both value and type) x=5
y="5"

x==y returns true
x===y returns false

!= is not equal 5!=8 returns true
> is greater than 5>8 returns false
< is less than 5<8 returns true
>= is greater than or equal to 5>=8 returns false
<= is less than or equal to 5<=8 returns true

Operator Usage Description
Bitwise AND a & b Returns a one in each bit position for which the corresponding bits of both operands are ones.
Bitwise OR a | b Returns a one in each bit position for which the corresponding bits of either or both operands are ones.
Bitwise XOR a ^ b Returns a one in each bit position for which the corresponding bits of either but not both operands are ones.
Bitwise NOT ~ a Inverts the bits of its operand.
Left shift a << b Shifts a in binary representation b bits to left, shifting in zeros from the right.
Sign-propagating right shift a >> b Shifts a in binary representation b bits to right, discarding bits shifted off.
Zero-fill right shift a >>> b Shifts a in binary representation b bits to the right, discarding bits shifted off, and shifting in zeros from the left.



Logical Operators

Logical operators are typically used with Boolean (logical) values; when they are, they return a Boolean value. However, the && and || operators actually return the value of one of the specified operands, so if these operators are used with non-Boolean values, they may return a non-Boolean value. The logical operators are described in the following table.


Operator Description Example
&& and x=6
y=3

(x < 10 && y > 1) returns true

|| or x=6
y=3

(x==5 || y==5) returns false

! not x=6
y=3

!(x==y) returns true

En plus des opérateurs de comparaison, qui peuvent être employés sur des valeurs de corde, l'opérateur de concaténation (+) enchaîne deux valeurs de corde ensemble, renvoyant une autre corde qui est l'union des deux cordes d'opérande. Par exemple, « mon » + « corde » renvoie la corde « ma corde ».

L'opérateur de tâche de sténographie += peut également être employé pour enchaîner des cordes. Par exemple, si mystring variable a la valeur « alpha, » alors l'expression mystring += « parié » évalue le « alphabet » et assigne cette valeur à mystring.


txt1="What a very"
txt2="nice day!"
txt3=txt1+txt2 




Previous Next

Keywords: javascript logical operators, comparison operators, assignment operators, bitwise operators


HTML Quizes
HTML Quiz
XHTML Quiz
CSS Quiz
TCP/IP Quiz
XML Quizes
XML Quiz
XSL Quiz
XSLT Quiz
DTD Quiz
Schema Quiz
XForms Quiz
XSL-FO Quiz
XML DOM Quiz
XLink Quiz
XQuery Quiz
XPath Quiz
XPointer Quiz
RDF Quiz
SOAP Quiz
WSDL Quiz
RSS Quiz
WAP Quiz
Web Services Quiz
Browser Scripting Quizes
JavaScript Quiz
VBScript Quiz
AJAX Quiz
DHTML Quiz
HTML DOM Quiz
WMLScript Quiz
E4X Quiz
Server Scripting Quizes
ASP Quiz
PHP Quiz
PERL Quiz
SQL Quiz
ADO Quiz
.NET (dotnet) Quizes
Microsoft.Net Quiz
XML Web Services Quiz
ASP.Net Quiz
.Net Mobile Quiz
C# : C Sharp Quiz
ADO.NET Quiz
VB.NET Quiz
Multimedia Quizes
SVG Quiz
Flash Quiz
Media Quiz
SMIL Quiz
Web Building  Quizes
Web Browsers Quiz
Web Hosting Quiz
W3C Quiz
Web Building Quiz
Web Quality Quiz
Web Semantic Quiz
Web Careers Quiz
Java Quizes
Java Quiz
JSP Quiz
Servlets Quiz
Struts Quiz
EJB Quiz
JMS Quiz
JMX Quiz
Programming Langauges Quizes
C Quiz
C++ Quiz
Visual Basic Quiz
Data Structures Using C Quiz
Soft Skills Quizes
Communication Skills Quiz
Time Management Quiz
Project Management Quiz
Team Work Quiz
Leadership Skills Quiz
Corporate Communication Quiz
Negotiation Skills Quiz

Privacy Policy
Copyright © 2003-2008 Vyom Technosoft Pvt. Ltd., All Rights Reserved.