Answers for "//Splice remove and add new elements in an array in javascript"

0

//Splice remove and add new elements in an array in javascript

const numbers = [3, 6, 4, 8, 9, 19, 15, 21, 45, 87];
const numberSplice = numbers.splice(4, 3, 1, 2, 3);
console.log(numberSplice);
//[ 9, 19, 15 ]
console.log(numbers);
// [3, 6, 4, 8, 1,2, 3, 21, 45, 87]
Posted by: Guest on December-26-2021

Code answers related to "//Splice remove and add new elements in an array in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language