Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to delete element in array in javascript

let value = 3

let arr = [1, 2, 3, 4, 5, 3]

arr = arr.filter(item => item !== value)

console.log(arr)
// [ 1, 2, 4, 5 ]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #delete #element #array #javascript
ADD COMMENT
Topic
Name
2+9 =