Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

array.splice

let arr = [1,2,3]

// delete elements:
arr.splice(/*starting index*/, /*number of elements to delete*/)

// delete and replace elements:
arr.splice(/*starting index*/, /*number of elements to delete*/, /* value(s) to replace what was deleted */)
Source by www.freecodecamp.org #
 
PREVIOUS NEXT
Tagged:
ADD COMMENT
Topic
Name
5+1 =