js copy part of array

JavaScript
// The slice function copies parts of an array and 
// do therefore not change the default array

let arr = ["apple", "kiwi", "banana", "pear"];

let newArray = arr.slice(1, 2)

console.log(newArray); // output : kiwi

Source

Also in JavaScript: