javascript remove item from array, if an item already existing in array

后端 未结 6 729
终归单人心
终归单人心 2021-01-25 23:03

following adds items to array:

var arrayOptions = [];

function AddToFilterOptionList(mode) {
    arrayOptions.push(mode);
    }

remove item fr

6条回答
  •  Happy的楠姐
    2021-01-25 23:50

    Cycle through the Array and then use the startsWith method.

    void AddToFilterOptionList(String mode) {
        for (i=0; i

提交回复
热议问题