Låne Penger | Sähkövertailu | Test av Kredittkort | Pris Strøm | Billigste Innbruddsalarm 2017 | Helseforsikring | Billigste Mobilabonnement | Billig Internett
JavaScript programming

Comparison Operator JavaScript

Programming in JavaScript Comparison Operators (Comparison Operator) is used, or the value of the variable as well as generally Darren technical analysis in order to compare. The comparison of the two types of technical analysis as a result of true and false results. Conditional and looping statements to create compilation operator (Comparison Operator) play an important role.

Logical operator services

Operator

Operator Name

Example

Results

==

Equal

a==b

Comparison of results of technical analysis would be true, if the value is equal to the == operator on both sides. For example var a = 5; And var b = 5; The result will be true if a == b.

===

Identical

a === b

Comparison of results of technical analysis would be true, if the value is equal on both sides === operator is the same type. For example var a = 23; And var b = 23; The result will be true if a === b. Because the values of variables a and b are equal and both the integer variable type.

!=

Not equal

a != b

Comparison of results of technical analysis would be true, if! = Is not equal to the value of the operator on both sides. For example var a = 5; And var b = 15; If a! = B will be true for the results.

!==

Not identical

a !== b

Comparison of results of technical analysis would be true, if the! == Operator is not equal on both sides of the value or type is not the same. For example var a = 5; And var b = 15; When
a! == b will be true for the results. Or var a = 15; And var b = “15”; Although a! == B will be true for the results. The value of the b variable of type String, and the value of a variable of type integer.

<

Less than

a < b

Comparison of results of technical analysis would be true, if <operator is smaller than the right side to the left side of the standard. For example var a = 5; And var b = 15; If a <b will be true for the results.

>

Greater than

a >b

Comparison of results of technical analysis would be true, if> on the left side of the operator is greater than the value on the right side. For example var a = 25; And var b = 15; If a> b will be true for the results.

<=

Less than or equal to

a <= b

Comparison of results of technical analysis would be true, if <= operator is smaller than the right side or the left side is equal to the value. For example var a = 5; And var b = 15; If a <= b will be true for the results. Or var a = 5; And var b = 5; Although a <= b will be true for the results.

>=

Greater than or equal to

a >= b

Comparison of results of technical analysis would be true, if the> = operator on the left side of the value is greater than the right side. For example var a = 25; And var b = 15; If a> = b will be true for the results. Or var a = 15; And var b = 15; Although a> = b will be true for the results.

Practice Project

<html>
<head>
<title> www.trickbd.com.bd</title>
<style>
body{background: #FFC;
font-size:20px;}
h2{color:#FF0066;}
</style>

</head>
<body>
<script type = “text/javascript”>
//Example For Equal Operator.
var a=5;
var b=5;
document.write(“<p> A = “+ a + “.</p>”);
document.write(“<p> B = “+ b + “.</p>”);
if(a == b)
{document.write(“<p> Result of A == B is : True .</p>”);}
else {document.write(“<p> Result of A == B is : False .</p>”);}
</script>
<script type = “text/javascript”>
//Example For Identical Operator.
var c=23;
var d=23;
document.write(“<p> C = “+ c + “.</p>”);
document.write(“<p> D = “+ d + “.</p>”);
if(c === d)
{document.write(“<p> Result of C === D is : True .</p>”);}
else {document.write(“<p> Result of C === D is : False .</p>”);}
</script>
<script type = “text/javascript”>
//Example For Not equal Operator.
var e=5;
var f=15;
document.write(“<p> E = “+ e + “.</p>”);
document.write(“<p> F = “+ f + “.</p>”);
if(e != f)
{document.write(“<p> Result of E != F is : True .</p>”);}
else {document.write(“<p> Result of E != F is : False .</p>”);}
</script>
<script type = “text/javascript”>
//Example For Not identical Operator.
var g=5;
var h=15;
document.write(“<p> G = “+ g + “.</p>”);
document.write(“<p> H = “+ h + “.</p>”);
if(g !== h)
{document.write(“<p> Result of G !== H is : True .</p>”);}
else {document.write(“<p> Result of G !== H is : False .</p>”);}
var i=”15″;
var j=15;
document.write(“<p> I = “+ i + “.</p>”);
document.write(“<p> J = “+j + “.</p>”);
if(i !== j)
{document.write(“<p> Result of I !== J is : True .</p>”);}
else {document.write(“<p> Result of I !== J is : False .</p>”);}
</script>
<script type = “text/javascript”>
//Example For Less than Operator.
var k=5;
var l=15;
document.write(“<p> K = “+ k + “.</p>”);
document.write(“<p> L = “+ l + “.</p>”);
if(k < l)
{document.write(“<p> Result of K < L is : True .</p>”);}
else {document.write(“Result of K < L is : False .</p>”);}
</script>
<script type = “text/javascript”>
//Example For Greater than Operator.
var m=25;
var n=15;
document.write(“<p> M = “+ m + “.</p>”);
document.write(“<p> N = “+ n + “.</p>”);
if(m > n)
{document.write(“<p> Result of M > N is : True .</p>”);}
else {document.write(“Result of M > N is : False .</p>”);}
</script>
<script type = “text/javascript”>
//Example For Less than or equal to Operator.
var o=5;
var p=15;
document.write(“<p> O = “+ o + “.</p>”);
document.write(“<p> P = “+ p + “.</p>”);
if(o <= p)
{document.write(“<p> Result of O <= P is : True .</p>”);}
else {document.write(“Result of O <= P is : False .</p>”);}
var q=5;
var r=5;
document.write(“<p> Q = “+ q + “.</p>”);
document.write(“<p> R = “+ r + “.</p>”);
if(q <= r)
{document.write(“<p> Result of Q <= R is : True .</p>”);}
else {document.write(“Result of Q <= R is : False .</p>”);}
</script>
<script type = “text/javascript”>
//Example For Greater than or equal to Operator.
var s=25;
var t=15;
document.write(“<p> S = “+ s + “.</p>”);
document.write(“<p> T = “+ t + “.</p>”);
if(s >= t)
{document.write(“<p> Result of S >= T is : True .</p>”);}
else {document.write(“Result of S >= T is : False .</p>”);}
var u=5;
var v=5;
document.write(“<p> U = “+ u + “.</p>”);
document.write(“<p> V = “+ v + “.</p>”);
if(u >= v)
{document.write(“<p> Result of U >= V is : True .</p>”);}
else {document.write(“Result of U >= V is : False .</p>”);}
</script>
</body>

</html>

Notepad to open a file type from the menu at the top of layer code by clicking on the Save as File name: index.html, Save as type: All files, save and open the index.html file with the Mozilla Firefox look like the image shown below.


A = 5.

B = 5.

Result of A == B is : True .

C = 23.

D = 23.

Result of C === D is : True .

E = 5.

F = 15.

Result of E != F is : True .

G = 5.

H = 15.

Result of G !== H is : True .

I = 15.

J = 15.

Result of I !== J is : True .

K = 5.

L = 15.

Result of K < L is : True .

M = 25.

N = 15.

Result of M > N is : True .

O = 5.

P = 15.

Result of O <= P is : True .

Q = 5.

R = 5.

Result of Q <= R is : True .

S = 25.

T = 15.

Result of S >= T is : True .

U = 5.

V = 5.

Result of U >= V is : True .


 

Comments

comments

About the author

Toriqul Islam Tusher

বলার মত কিছু নাই!

Leave a Comment