---
name: "a or b"
type: command
operator: "||"
status: ok
groups: ["Math", "Variables"]
arma3_since: "0.50"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/a_or_b
revid: 349256
updated: 2023-11-08T14:51:04Z
---

# a or b

*Command · Math, Variables · Arma 3 v0.50 · introduced in Operation Flashpoint v1.00*

Alias: [or](../commands/or.md)

## Description

Returns [true](../commands/true.md) if one or both conditions are [true](../commands/true.md). In case of the alternative syntax, [lazy evaluation](https://en.wikipedia.org/wiki/Lazy_evaluation#Control_structures) is used. That means that if left operand is [true](../commands/true.md), evaluation of the right side is skipped completely.

## Syntax

### Syntax 1

```sqf
a || b
```

**Parameters:**

- `a`: [Boolean](../topics/Boolean.md) - test condition or variable
- `b`: [Boolean](../topics/Boolean.md) - test condition or variable

**Returns:** [Boolean](../topics/Boolean.md)

### Syntax 2

*since arma2oa 1.62*

```sqf
a || b
```

**Parameters:**

- `a`: [Boolean](../topics/Boolean.md) - test condition or variable
- `b`: [Code](../topics/Code.md) - code that returns [Boolean](../topics/Boolean.md). It is not evaluated if *a* returns [true](../commands/true.md)

**Returns:** [Boolean](../topics/Boolean.md)

## Examples

### Example 1

```sqf
if (OBJ1 || _enemycount == 0) then { hint "you win !" };
```

### Example 2

```sqf
if (count _array == 0 || { (_array select 0) != player }) then
{
    hint "It works! Without lazy evaluation it would throw an error if array was empty.";
};
```

## See also

[or](../commands/or.md) · [and](../commands/and.md) · [Operators](../topics/Operators.md)

<sub>Source: [BI Community Wiki — a or b](https://community.bistudio.com/wiki/a_or_b) (revision 349256).</sub>
