{"name":"BIS_fnc_removeIndex","title":"BIS fnc removeIndex","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_removeIndex","revid":323162,"updated":"2022-07-01T10:34:55Z","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":"Takes an array, and returns a new array with the specified index(es) removed.\nThis takes the array passed in the first parameter, and returns an array that has the index number in the second parameter removed.\nIf a third parameter is passed, then a range of indexes will be removed.\nAlternatively, an array of indices to remove can be passed in the second parameter.\n\n> [!NOTE]\n> **Arma 3:** Use deleteAt or deleteRange instead.","syntaxes":[{"syntax":"[array, startIndex, endIndex] call BIS_fnc_removeIndex","params":[{"name":"array","type":"Array","type_expr":"Array"},{"name":"startIndex","type":"Number","description":"start index to be removed, if Parameter 3 is not provided, only this index is removed","type_expr":"Number"},{"name":"endIndex","type":"Number","optional":true,"default":"Nothing","description":"end index, if provided the indexs from startIndex to endIndex will be removed","type_expr":"Number","text":"endIndex: Number - (Optional, default Nothing) - end index, if provided the indexs from startIndex to endIndex will be removed"}],"returns":{"type":"Array","type_expr":"Array","description":"new array with new values"}},{"syntax":"[array, indices] call BIS_fnc_removeIndex","params":[{"name":"array","type":"Array","type_expr":"Array"},{"name":"indices","type":"Array of Numbers","description":"indices to be removed","type_expr":"Array<Number>"}],"returns":{"type":"Array","type_expr":"Array","description":"new array with new values"}}],"examples":[{"code":["private _array = [0,1,2,3,4];\n[array, 0] call BIS_fnc_removeIndex; // returns [1,2,3,4]"]},{"code":["private _array = [0,1,2,3,4];\n[_array, 0, 4] call BIS_fnc_removeIndex; // returns []"]},{"code":["private _array = [0,1,2,3,4];\n[_array, [0,4]] call BIS_fnc_removeIndex; // returns [1,2,3]"]}],"see_also":["deleteAt","deleteRange"]}