Every line of 'remove data from array react' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.
341 static removeValue(array, value) { 342 for (var tI = array.length - 1; tI >= 0; tI--) { 343 if (array[tI] === value) { 344 array.splice(tI, 1); 345 } 346 } 347 }
48 export function remove(array, index) { 49 var len = array.length - 1; 50 51 var out = new Array(len); 52 53 var i = 0; 54 while (i < index) { 55 out[i] = array[i]; 56 ++i; 57 } 58 59 while (i < len) { 60 out[i] = array[i + 1]; 61 ++i; 62 } 63 64 return out; 65 }
4 function remove_element(arr, val) { 5 var i = arr.indexOf(val); 6 return i>-1 ? arr.splice(i, 1) : []; 7 };
27 static remove(array = [], index = 0) { 28 return index >= 0 ? array.splice(index, 1) : []; 29 }
37 function removeValue (arr, v) { 38 _.remove(arr, (item) => item === v); 39 }
155 function removeData(currentData, currentDataIndex, id) { 156 const index = currentDataIndex[id] 157 const data = [...currentData] 158 const dataIndex = { ...currentDataIndex } 159 delete dataIndex[id]; 160 161 data.splice(index, 1) 162 for (let i = data.length - 1; i >= index; i--) { 163 dataIndex[data[i].id] = i 164 } 165 166 return { data, dataIndex } 167 }
11 export function removeArray(array, val, callback) { 12 var index = array.indexOf(val); 13 //如果找到 14 if (index > -1) { 15 callback && callback() 16 array.splice(index, 1); 17 } 18 }
199 value: function remove(obj) { 200 var i = this.tweens.length; 201 while (i--) { 202 var t = this.tweens[i]; 203 if (t._reference === obj) { 204 this.tweens.splice(i, 1); 205 } 206 } 207 }
40 removeItem(index: number) { 41 this.formProperty.remove(index); 42 }
12 export function removeByValue(data: V[], value: V): V[] { 13 const index = data.indexOf(value) 14 if (index !== -1) { 15 data.splice(index, 1) 16 } 17 return data 18 }