In the premise does not know B in this array subscript, delete b this element
var arrlist = [' A ', ' B ', ' C ', ' d '];
Arrlist.splice (Jquery.inarray (' B ', arrlist), 1);
alert (arrlist);
where Jquery.inarray (' B ', arrlist) is the position of the element B in the array arrlist
The first parameter in the splice (index,1) function is the position of the element in the array to be deleted, and the second parameter is the number to be deleted.
The methods of the array object are:
Concat () joins two or more arrays and returns the result.
Join () Places all elements of an array into a string. element is delimited by the specified delimiter.
Pop () deletes and returns the last element of the array.
Push () adds one or more elements to the end of the array and returns the new length.
Reverse () Reverses the order of the elements in the array.
Shift () deletes and returns the first element of the array
Slice () returns the selected element from an existing array
Sort () Sorts the elements of an array
Splice () Deletes the element and adds a new element to the array.
Tosource () returns the source code of the object.
ToString () converts the array to a string and returns the result.
toLocaleString () converts the array to a local array and returns the result.
Unshift () adds one or more elements to the beginning of the array and returns the new length.
ValueOf () returns the original value of the array object.
var arrlist = new Array ();
Arrlist.push ("abc");
var arr = new Array (3)
Arr[0] = "George"
ARR[1] = "John"
ARR[2] = "Thomas"
document.write (Arr.join ())
Reference:
Http://www.w3school.com.cn/jsref/jsref_obj_array.asp
jquery array add element