Q:

jquery OR operator

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
37
//The OR operator in Javascript is 2 verticals lines: ||

//Example
var booleanOne = true;
var booleanTwo = false;

if(booleanOne || booleanTwo) {
	//At least one boolean is true -> code excuted
}
11
if (x === 5 || x === 8)
  console.log("x is eaqual to 5 OR 8")
1
//x = 5

operator  |	example	 |	output  |	explination

==			x == 8		false		equal to
			x == 5		true
			x == "5"	true

===			x === 5		true		equal value and type
			x === "5"	false

!=			x != 8		true		not equal

!==			x !== 5		false		not equal value or not equal type
			x !== "5"	true
			x !== 8		true

>			x > 8		false		greater than

<			x < 8		true		less than

>=			x >= 8		false		greater than or equal to

<=			x <= 8		true		less than or equal to
7
$('[myc="blue"],[myid="1"],[myid="3"]');
0
jQuery is a fast, small, and feature-rich JavaScript library.
It makes things like HTML document traversal and manipulation,
event handling, animation, and Ajax much simpler with an easy-to-use
API that works across a multitude of browsers.

With a combination of versatility and extensibility,
jQuery has changed the way that millions of people write JavaScript.
-1
if(booleanOne && booleanTwo) {
	//Both booleanOne and booleanTwo are true here
}
-2

New to Communities?

Join the community