{"ScriptPreparationCode":"/* these functions assume that only one element matches, so they do not loop! */\r\n\r\nfunction deleteBySplice (array, name) {\r\n var index = array.findIndex(element =\u003E element.name = name);\r\n if (index !== -1) {\r\n \tarray.splice( index, 1 );\r\n }\r\n}\r\n\r\nfunction deleteByFilter (array, name) {\r\n array = array.filter(element =\u003E element !== name);\r\n}","TestCases":[{"Name":"Delete by Splice","Code":"deleteBySplice( array, \u00227d9nkqdcq9c65jhwdfp5fp3nmi\u0022 );\r\ndeleteBySplice( array, \u0022m1c6kzws0iubt8g0zlsug14i\u0022 );\r\ndeleteBySplice( array, \u0022est573afhw1cg83xlxe6ogvi\u0022 );\r\ndeleteBySplice( array, \u0022doesnotexist\u0022 );","IsDeferred":false},{"Name":"Delete by Filter","Code":"deleteByFilter( array, \u00227d9nkqdcq9c65jhwdfp5fp3nmi\u0022 );\r\ndeleteByFilter( array, \u0022m1c6kzws0iubt8g0zlsug14i\u0022 );\r\ndeleteByFilter( array, \u0022est573afhw1cg83xlxe6ogvi\u0022 );\r\ndeleteByFilter( array, \u0022doesnotexist\u0022 );","IsDeferred":false}]}