{"name":"BIS_fnc_findNestedElement","title":"BIS fnc findNestedElement","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_findNestedElement","revid":327731,"updated":"2022-07-13T10:17:58Z","groups":["Arrays"],"status":"ok","games":{"arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"arma2 1.00","arma3_since":"0.50","description":"Function to find item in nested arrays and return a path to the first match.\n\n> [!NOTE]\n> **Arma 3:** In some cases findIf might be the better way of finding a nested element. It is a lot faster!","syntaxes":[{"syntax":"[array, query] call BIS_fnc_findNestedElement","params":[{"name":"array","type":"Array","description":"array to explore","type_expr":"Array"},{"name":"query","type":"Anything","description":"wanted item","type_expr":"Anything"}],"returns":{"type":"Array of Numbers","type_expr":"Array<Number>","description":"path to the first occurence of query","text":"Array of Numbers - path to the first occurence of *query*"}}],"examples":[{"code":["private _array = [[1, 2], [3, 4]];\n_path = [_array, 3] call BIS_fnc_findNestedElement; // expected result: [1, 0]\n// ((_array select 1) select 0) == 3"]}],"see_also":["BIS_fnc_findAllNestedElements","BIS_fnc_removeNestedElement","BIS_fnc_returnNestedElement","BIS_fnc_setNestedElement"]}