{"ScriptPreparationCode":"/* these functions assume that only one element matches, so they do not loop! */\r\n\r\nfunction deleteBySplice (array, element) {\r\n var index = array.indexOf( element );\r\n if (index !== -1) {\r\n \tarray.splice( index, 1 );\r\n }\r\n}\r\n\r\nfunction deleteByCopyWithin (array, element) {\r\n var index = array.indexOf( element );\r\n if (index !== -1) {\r\n \tarray.copyWithin( index, index \u002B 1 );\r\n --array.length;\r\n }\r\n}\r\n\r\nfunction deleteByFilter (array, element) {\r\n array = array.filter( el =\u003E el !== element );\r\n}","TestCases":[{"Name":"Delete by Splice","Code":"deleteBySplice( array, 21 );\r\ndeleteBySplice( array, 304 );\r\ndeleteBySplice( array, 777 );","IsDeferred":false},{"Name":"Delete by copyWithin","Code":"deleteByCopyWithin( array, 21 );\r\ndeleteByCopyWithin( array, 304 );\r\ndeleteByCopyWithin( array, 777 );","IsDeferred":false},{"Name":"Delete by Filter","Code":"deleteByFilter( array, 21 );\r\ndeleteByFilter( array, 304 );\r\ndeleteByFilter( array, 777 );","IsDeferred":false}]}