Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

JavaScript Array slice() example

let numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
let newArray = numbers.slice(4,8);
console.log("The sliced arrays is:", newArray)

// Output: The sliced arrays is: [ 5, 6, 7, 8 ]
Source by itsjavascript.com #
 
PREVIOUS NEXT
Tagged: #JavaScript #Array
ADD COMMENT
Topic
Name
9+3 =