---
name: "a == 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_%3D%3D_b
revid: 369426
updated: 2024-09-03T18:48:52Z
---

# a == b

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

## Description

Check if *a* is equal to *b*. String comparison is case-**in**sensitive  - use [isEqualTo](../commands/isEqualTo.md) if case sensitivity is needed.

> [!IMPORTANT]
> *a* and *b* types **must** match: comparing e.g [String](../topics/String.md) with [Number](../topics/Number.md) is invalid.

## Syntax

```sqf
a == b
```

**Parameters:**

- `a`:

  | Introduced in | Operation Flashpoint v1.00 | Armed Assault v1.00 | Armed Assault v1.08 | Arma 3 v2.00 |  |  |  |  |  |  |  |  |  |
  |---|---|---|---|---|---|---|---|---|---|---|---|---|---|
  | Possible Type | [Number](../topics/Number.md) | [Side](../topics/Side.md) | [String](../topics/String.md) | [Object](../topics/Object.md) | [Group](../topics/Group.md) | [Structured Text](../topics/Structured_Text.md) | [Config](../topics/Config.md) | [Display](../topics/Display.md) | [Control](../topics/Control.md) | [Location](../topics/Location.md) | [Diary Record](../topics/Diary_Record.md) | [Namespace](../topics/Namespace.md) | [Boolean](../topics/Boolean.md) |
- `b`: identical to *a*'s type

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

## Examples

### Example 1

```sqf
if (player == leader group player) then
{
    hint "You are the leader of your group.";
}
else
{
    hint "Someone else is the boss";
};
```

### Example 2

```sqf
"MyRabbit" == "MYRABBIT"; // returns true
```

### Example 3

```sqf
if (alive _unit1 == alive _unit2) then { hint "Both units are either dead or both alive" };
```

## See also

[a != b](../commands/a_~21~3D_b.md) · [Operators](../topics/Operators.md) · [isEqualTo](../commands/isEqualTo.md)

## Community notes

**ffur2007slx2_5** — 2014-04-15

For script comparison we need to detect whether scripts are running in advance, then compose both into string:

```sqf
if (scriptDone _var0) then [{false},{(str _var0) == (str _var1)}];
```

It is recommended to use [isEqualTo](../commands/isEqualTo.md) for all types comparison, which is more functional and as fast as operator.
For multiple comparisons:

```sqf
fnc_areEqual = {
    private ["_b", "_var1", "_var2"];
    _b = true;
    for [{ _i = 1 }, { _i < (count _this) && _b }, { _i=_i + 1 }] do {
        _var1 = _this select (_i-1);
        _var2 = _this select _i;
        if (!(_var1 isEqualTo _var2)) then { _b = false; };
    };
    _b
};
["A","a","a"] call fnc_areEqual; // false
```

And we can use such workaround instead of using [BIS_fnc_arrayCompare](../functions/BIS_fnc_arrayCompare.md) or [BIS_fnc_areEqual](../functions/BIS_fnc_areEqual.md)

<sub>Source: [BI Community Wiki — a == b](https://community.bistudio.com/wiki/a_%3D%3D_b) (revision 369426).</sub>
