{"ScriptPreparationCode":"/* these functions assume that only one element matches, so they do not loop! */\r\n\r\nfunction deleteAddBySplice (array, element, newElement) {\r\n var index = array.indexOf( element );\r\n if (index !== -1) {\r\n \tarray.splice( index, 1,newElement );\r\n }\r\n}\r\n\r\nfunction addElementByIndex (array, index, element) {\r\n array[index] = element;\r\n}","TestCases":[{"Name":"deleteAddBySplice","Code":"deleteAddBySplice(array, \u00224wlivut0n1ht80rs5lyf7ds4i\u0022,\u0022POLICE\u0022);\r\ndeleteAddBySplice(array, \u0022m1c6kzws0iubt8g0zlsug14i\u0022,\u0022POLICE\u0022);\r\ndeleteAddBySplice(array, \u0022uyjxmtqnrzvj7mkyqmtoqolxr\u0022,\u0022POLICE\u0022);","IsDeferred":false},{"Name":"addElementByIndex","Code":"addElementByIndex(array, 0, \u0022POLICE\u0022)\r\naddElementByIndex(array, 10, \u0022POLICE1\u0022)\r\naddElementByIndex(array, 20, \u0022POLICE2\u0022)","IsDeferred":false}]}