Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

remove element from array javascript

let numbers = [1,2,3,4]

// to remove last element
let lastElem = numbers.pop()

// to remove first element
let firstElem = numbers.shift()

// both these methods modify array while returning the removed element
Source by love2dev.com #
 
PREVIOUS NEXT
Tagged: #remove #element #array #javascript
ADD COMMENT
Topic
Name
4+7 =