{"name":"a == b","operator":"==","title":"a == b","type":"command","url":"https://community.bistudio.com/wiki/a_%3D%3D_b","revid":379203,"updated":"2026-10-30T20:32:32Z","groups":["Math","Variables"],"status":"ok","games":{"ofp":"1.00","ofpe":"1.00","arma1":"1.00","arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"ofp 1.00","arma3_since":"0.50","description":"Check if *a* is equal to *b*. String comparison is case-**in**sensitive - use isEqualTo if case sensitivity is needed.\n\n> [!IMPORTANT]\n> *a* and *b* types **must** match: comparing e.g String with Number is invalid.","syntaxes":[{"syntax":"a == b","params":[{"name":"a","description":"| Introduced in | Operation Flashpoint v1.00 |  |  |  |  | Armed Assault v1.00 |  |  |  | Armed Assault v1.08 | Arma 3 v2.00 |  |  |\n|---|---|---|---|---|---|---|---|---|---|---|---|---|---|\n| Possible Type | Number | Side | String | Object | Group | Structured Text | Config | Display | Control | Location | Diary Record | Namespace | Boolean |","type_expr":"Number | Side | String | Object | Group | Structured Text | Config | Display | Control | Location | Diary Record | Namespace | Boolean","text":"a:\n\n| Introduced in | Operation Flashpoint v1.00 |  |  |  |  | Armed Assault v1.00 |  |  |  | Armed Assault v1.08 | Arma 3 v2.00 |  |  |\n|---|---|---|---|---|---|---|---|---|---|---|---|---|---|\n| Possible Type | Number | Side | String | Object | Group | Structured Text | Config | Display | Control | Location | Diary Record | Namespace | Boolean |"},{"name":"b","type":"identical to a's type","text":"b: identical to *a*'s type"}],"returns":{"type":"Boolean","type_expr":"Boolean"},"form":"binary","left":{"text":"a"},"right":{"text":"b"}}],"examples":[{"text":"```sqf\nif (player == leader group player) then\n{\n    hint \"You are the leader of your group.\";\n}\nelse\n{\n    hint \"Someone else is the boss\";\n};\n```","code":["if (player == leader group player) then\n{\n\thint \"You are the leader of your group.\";\n}\nelse\n{\n\thint \"Someone else is the boss\";\n};"]},{"code":["\"MyRabbit\" == \"MYRABBIT\"; // returns true"]},{"code":["if (alive _unit1 == alive _unit2) then { hint \"Both units are either dead or both alive\" };"]}],"see_also":["a != b","Operators","isEqualTo"],"notes":[{"user":"ffur2007slx2_5","date":"2014-04-15T10:13:00Z","text":"For script comparison we need to detect whether scripts are running in advance, then compose both into string:\n\n```sqf\nif (scriptDone _var0) then [{false},{(str _var0) == (str _var1)}];\n```\n\nIt is recommended to use isEqualTo for all types comparison, which is more functional and as fast as operator.\nFor multiple comparisons:\n\n```sqf\nfnc_areEqual = {\n    private [\"_b\", \"_var1\", \"_var2\"];\n    _b = true;\n    for [{ _i = 1 }, { _i < (count _this) && _b }, { _i=_i + 1 }] do {\n        _var1 = _this select (_i-1);\n        _var2 = _this select _i;\n        if (!(_var1 isEqualTo _var2)) then { _b = false; };\n    };\n    _b\n};\n[\"A\",\"a\",\"a\"] call fnc_areEqual; // false\n```\n\nAnd we can use such workaround instead of using BIS_fnc_arrayCompare or BIS_fnc_areEqual"}]}