JS deletes the specified value in the array element:
The so-called deletion of the value specified in the array element is the deletion of the specified array item, and the following is an example of how to implement this function through the instance code code.
The code is as follows:
var thearray=["Ant Tribe", 2, "Qingdao South District", "Antzone", "Ant Tribe"]; for (var i=0;i<thearray.length;i++) { if(thearray[i]== "Ant Tribe") { Thearray.splice (i,1); }} Console.log (TheArray);
The above code to achieve our requirements, the code is relatively simple here is not more introduction.
The splice () function can refer to the Splice () method section of the JavaScript array object .
The original address is: http://www.softwhy.com/forum.php?mod=viewthread&tid=11924
For more information, refer to: http://www.softwhy.com/javascript/
JS Delete the specified value in the array element