{"name":"BIS_fnc_findNestedElement","operator":null,"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","replaced_by":[],"games":[{"game":"arma2","name":"Arma 2","version":"1.00"},{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.50"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"arma2","name":"Arma 2","version":"1.00"},"arma3_since":"0.50","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"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","since":null,"effect":null,"exec":null,"params":[{"name":"array","type":"Array","optional":false,"default":null,"description":"array to explore","types":["Array"],"since":null,"text":"array: Array - array to explore"},{"name":"query","type":"Anything","optional":false,"default":null,"description":"wanted item","types":["Anything"],"since":null,"text":"query: Anything - wanted item"}],"returns":{"type":"Array of Numbers","types":["Array","Number"],"description":"path to the first occurence of query","text":"Array of Numbers - path to the first occurence of *query*"}}],"examples":[{"text":"```sqf\nprivate _array = [[1, 2], [3, 4]];\n_path = [_array, 3] call BIS_fnc_findNestedElement; // expected result: [1, 0]\n// ((_array select 1) select 0) == 3\n```","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"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["BIS_fnc_findAllNestedElements","BIS_fnc_removeNestedElement","BIS_fnc_returnNestedElement","BIS_fnc_setNestedElement"],"notes":[],"categories":["Arma 2: Functions","Arma 2: New Functions","Arma 2: Operation Arrowhead: Functions","Arma 3: Functions","Function Group: Arrays","Functions","Introduced with Arma 2 version 1.00","Take On Helicopters: Functions"],"docblock":null,"filled_from_docblock":[]}