Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Javascript splice

const numbers = [2, 4, 5, 3, 8, 9, 11, 33, 44];
const spliceNumbers = numbers.splice(0, 5)
//start from 0 && remove next 5 elements
console.log(spliceNumbers)
//Expected output:[ 2, 4, 5, 3, 8 ]
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #Javascript #splice
ADD COMMENT
Topic
Name
7+2 =