Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn OR Logical Operator | Section
JavaScript Fundamentals

bookOR Logical Operator

Swipe to show menu

The || (OR) operator is used for defining the "or" relation between two or more expressions.

It returns true if any of the expressions evaluate to true.

Example:

12345
let a = 9; if(a < 10 || a > 30) { console.log("Condition Matched"); }
copy

The above code output "Condition Matched" when a is less than 10 OR a is greater than 30.

question mark

What is the result of the following expression if x = 5?

Select the correct answer

Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 1. Chapter 41

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

Section 1. Chapter 41
some-alt