{"name":"-","operator":"-","title":"-","type":"command","url":"https://community.bistudio.com/wiki/-","revid":379201,"updated":"2026-10-30T20:29:40Z","groups":["Math","Arrays"],"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":"Subtracts numbers or arrays from each another, negates a number. For arrays also see deleteAt and deleteRange.\n\n> [!NOTE]\n> **Arma 3:** In Arma 3 it is possible to subtract nested arrays.","syntaxes":[{"syntax":"numberA - numberB","params":[{"name":"numberA","type":"Number","type_expr":"Number"},{"name":"numberB","type":"Number","type_expr":"Number"}],"returns":{"type":"Number","type_expr":"Number"},"form":"binary","left":{"text":"numberA"},"right":{"text":"numberB"}},{"syntax":"- numberA","params":[{"name":"numberA","type":"Number","type_expr":"Number"}],"returns":{"type":"Number","type_expr":"Number","description":"the negative of numberA","text":"Number - the negative of *numberA*"},"form":"unary","right":{"text":"numberA"}},{"syntax":"arrayA - arrayB","params":[{"name":"arrayA","type":"Array of Anything","type_expr":"Array<Anything>"},{"name":"arrayB","type":"Array of Anything","type_expr":"Array<Anything>"}],"returns":{"type":"Array of Anything","type_expr":"Array<Anything>"},"form":"binary","left":{"text":"arrayA"},"right":{"text":"arrayB"}}],"examples":[{"code":["_result = 10 - 7; // result is 3"]},{"code":["_numA = 4;\n_numB = -_numA; // result is -4\n_numB = -_numB; // result is  4"]},{"code":["_result = [1, 2, 2, player, \"String\"] - [2, player, player, \"String\"]; // _result is [1]"]},{"code":["_result = [0, [0], [[0]]] - [0]; // [[0], [[0]]]"]},{"text":"```sqf\n_result = [0, [0], [[0]]] - [[0]];        // [0, [[0]]]    - Since Arma 3\n_result = [0, [0], [[0]]] - [[[0]]];    // [0, [0]]        - Since Arma 3\n```","code":["_result = [0, [0], [[0]]] - [[0]];\t\t// [0, [[0]]]\t- Since Arma 3\n_result = [0, [0], [[0]]] - [[[0]]];\t// [0, [0]]\t\t- Since Arma 3"]}],"see_also":["Array","Operators","deleteAt","deleteRange"]}