Knowledge Walls
Ammu
Hyderabad, Andhra Pradesh, India
Passcode:
Operator in Examples of Javascript 1
1391 Views
Description 
Arithmetic operator: + - * / %
Comparison operator: == != > < >= <=
Logical Operator
(a == b) && (a == c)
t && t t
t && f f
f && t f
f && f f

||
t || t t
t || f t
f || t t
f || f f

! - not
!t - f
!f - t

Assignment Operator
a = a + 1 | a += 1
a = a * 1 | a *= 1
a = a / 1 | a /= 1
a = a - 1 | a -= 1

Increment Decrement Operator
++variable | variable++
--variable | variable--

a = 10;
c = ++a;
c = a++;

(a++ | ++a) | a = a + 1
(a-- | --a) | a = a - 1
example
	<!DOCTYPE html>

	<html lang="en-US">

	<head>

	<meta charset="UTF-8">

	<title>internal</title>

	 

	</head>

	<body>

	<script>

	var a=10;b=5;var c;var d;var e;var f=10;var j;var k;

	c=a++;

	d=--b;

	e=--a;

	f+=e;

	j=(a==f);

	k=(a>f);

	document.write("result"+j||k+"<br>");//logical operator

	document.write("j"+j+"<br>");//

	document.write("c"+c+"<br>");

	document.write("d"+d+"<br>");

	document.write("e"+e+"<br>");

	document.write("j"+j+"<br>");//Assignment operator

	document.write("boolean"+Boolean(a>b)+"<br>");//boolean operator

	</script>

	</body>

	</html>
Next Topics
Next lessons of current book.
Examples of Javascript 1
Examples of Javascript 1
Examples of Javascript 1
Examples of Javascript 1
Previous Topics
Previous lessons of current book.
Examples of Javascript 1
Best Lessons of "Javascript 1"
Top lessons which are viewed more times.
Examples of Javascript 1
Examples of Javascript 1
Examples of Javascript 1
Examples of Javascript 1
Examples of Javascript 1
Examples of Javascript 1
  Copyright © 2014 Knowledge walls, All rights reserved
KnowledgeWalls
keep your tutorials and learnings with KnowledgeWalls. Don't lose your learnings hereafter. Save and revise it whenever required.
Click here for more details