|| (OR)

|| (OR)

Most of the time, OR || is used in an if statement to test if any of the given conditions is correct.

Let hour = 9;

*!*
if (hour < 10 || hour > 18) {
*/!*
  alert( 'The office is closed.' );
}
Given multiple OR'ed values:

result = value1 || value2 || value3;

Syntax

Alert( true || true );   // true
alert( false || true );  // true
alert( true || false );  // true
alert( false || false ); // false

|| (OR) — Structure map

Clickable & Draggable!

|| (OR) — Related pages: